• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

net-daemon / netdaemon / 6682362857

29 Oct 2023 08:56AM UTC coverage: 79.505% (-1.2%) from 80.706%
6682362857

push

github

web-flow
Bump Roslynator.Analyzers from 4.5.0 to 4.6.1 (#960)

Bumps [Roslynator.Analyzers](https://github.com/dotnet/roslynator) from 4.5.0 to 4.6.1.
- [Release notes](https://github.com/dotnet/roslynator/releases)
- [Changelog](https://github.com/dotnet/roslynator/blob/main/ChangeLog.md)
- [Commits](https://github.com/dotnet/roslynator/compare/v4.5.0...v4.6.1)

---
updated-dependencies:
- dependency-name: Roslynator.Analyzers
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

802 of 1143 branches covered (0.0%)

Branch coverage included in aggregate %.

2895 of 3507 relevant lines covered (82.55%)

50.4 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

62.96
/src/HassModel/NetDeamon.HassModel/Entities/NumericEntity.cs
1
namespace NetDaemon.HassModel.Entities;
2

3
/// <summary>
4
/// Entity that has a numeric (double) State value
5
/// </summary>
6
public record NumericEntity : Entity
×
7
{
8
    /// <summary>Copy constructor from base class</summary>
9
    public NumericEntity(IEntityCore entity) : base(entity) { }
16✔
10
    
11
    /// <summary>Constructor from haContext and entityId</summary>
12
    public NumericEntity(IHaContext haContext, string entityId) : base(haContext, entityId) { }
×
13
        
14
    /// <summary>The current state of this Entity converted to double if possible, null if it is not</summary>
15
    public new double? State => EntityState?.State;
7!
16

17
    /// <inheritdoc/>
18
    public override NumericEntityState? EntityState => base.EntityState == null ? null : new (base.EntityState);
9!
19
        
20
    /// <inheritdoc/>
21
    public override IObservable<NumericStateChange> StateAllChanges() => 
22
        base.StateAllChanges().Select(e => new NumericStateChange(this, 
7✔
23
            Entities.EntityState.Map<NumericEntityState>(e.Old),
7✔
24
            Entities.EntityState.Map<NumericEntityState>(e.New)));
7✔
25
        
26
    /// <inheritdoc/>
27
    public override IObservable<NumericStateChange> StateChanges() => StateAllChanges().StateChangesOnly();
1✔
28
}
29
    
30
/// <summary>
31
/// Entity that has a numeric (double) State value
32
/// </summary>
33
public record NumericEntity<TEntity, TEntityState, TAttributes> : Entity<TEntity, TEntityState, TAttributes>
×
34
    where TEntity : NumericEntity<TEntity, TEntityState, TAttributes>
35
    where TEntityState : NumericEntityState<TAttributes>
36
    where TAttributes : class
37
{
38
    /// <summary>Copy constructor from base class</summary>
39
    public NumericEntity(IEntityCore entity) : base(entity) { }
10✔
40

41
    /// <summary>Constructor from haContext and entityId</summary>
42
    public NumericEntity(IHaContext haContext, string entityId) : base(haContext, entityId) { }
×
43
        
44
    /// <summary>The current state of this Entity converted to double if possible, null if it is not</summary>
45
    public new double? State => EntityState?.State;
8!
46
        
47
    /// <summary>The full state of this Entity</summary>
48
    public new NumericEntityState<TAttributes>? EntityState => base.EntityState == null ? null : new (base.EntityState);
15!
49
    // we need a new here because EntityState is not covariant for TAttributes
50

51
    /// <inheritdoc/>
52
    public override IObservable<NumericStateChange<TEntity, TEntityState>> StateAllChanges() => 
53
        base.StateAllChanges().Select(e => new NumericStateChange<TEntity, TEntityState>((TEntity)this, e.Old, e.New));
8✔
54

55
    /// <inheritdoc/>
56
    public override IObservable<NumericStateChange<TEntity, TEntityState>> StateChanges() =>
57
        StateAllChanges().StateChangesOnly();
1✔
58
}
59
    
60
/// <summary>
61
/// Entity that has a numeric (double) State value
62
/// </summary>
63
public record NumericEntity<TAttributes> : NumericEntity<NumericEntity<TAttributes>, NumericEntityState<TAttributes>, TAttributes>
×
64
    where TAttributes : class
65
{
66
    // This type is needed because the base type has a recursive type parameter so it can not be used as a return value
67
        
68
    /// <summary>Copy constructor from base class</summary>
69
    public NumericEntity(Entity entity) : base(entity) { }
8✔
70
    
71
    /// <summary>Constructor from haContext and entityId</summary>
72
    public NumericEntity(IHaContext haContext, string entityId) : base(haContext, entityId) { }
×
73
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc