• 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

83.33
/src/HassModel/NetDeamon.HassModel/Event.cs
1
namespace NetDaemon.HassModel;
2

3
/// <summary>
4
/// Represents an Event from Home Assistant
5
/// </summary>
6
public record Event
2✔
7
{
8
    /// <summary>
9
    /// The EventData as a JsonElement
10
    /// </summary>
11
    [JsonPropertyName("data")]
12
    public JsonElement? DataElement { get; init; }
10✔
13

14
    /// <summary>
15
    /// The type of the Event
16
    /// </summary>
17
    [JsonPropertyName("event_type")]
18
    public string EventType { get; init; } = string.Empty;
14✔
19

20
    /// <summary>
21
    /// The Event Origin
22
    /// </summary>
23
    [JsonPropertyName("origin")]
24
    public string Origin { get; init; } = string.Empty;
11✔
25

26
    /// <summary>
27
    /// The Time the Event fired
28
    /// </summary>
29
    [JsonPropertyName("time_fired")]
30
    public DateTime? TimeFired { get; init; }
5✔
31
}
32

33
/// <summary>
34
/// Event with typed Data field
35
/// </summary>
36
/// <typeparam name="TData">The type of the event to deserialize into</typeparam>
37
public record Event<TData> : Event
×
38
    where TData : class
39
{
40
    /// <summary>Copy constructor from Base type</summary>
41
    public Event(Event source) : base(source)
2✔
42
    {
43
        _lazyData = new Lazy<TData?>(() => DataElement?.Deserialize<TData>());
4!
44
    }
2✔
45
        
46
    private Lazy<TData?> _lazyData;
47
        
48
    /// <summary>
49
    /// The Data of this Event deserialized as TData
50
    /// </summary>
51
    public TData? Data => _lazyData.Value;
6✔
52
}
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

© 2026 Coveralls, Inc