Skip to content

Commit be7ece2

Browse files
committed
Expose Service information
1 parent 27aec88 commit be7ece2

File tree

2 files changed

+80
-76
lines changed

2 files changed

+80
-76
lines changed

HomeKitDotNet/Models/Service.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,18 @@ namespace HomeKitDotNet.Models
1616
{
1717
public class Service : IService
1818
{
19-
protected Service(Accessory accessory, string type)
19+
protected Service(Accessory accessory, ServiceJSON json)
2020
{
21-
this.Type = type;
22-
this.Accessory = accessory;
21+
Accessory = accessory;
22+
Type = json.Type;
23+
Primary = json.PrimaryService;
24+
Hidden = json.HiddenService;
2325
}
2426

2527
public string Type { get; init; }
2628
public Accessory Accessory { get; init; }
29+
public bool Primary { get; init; }
30+
public bool Hidden { get; init; }
2731

2832
protected CharacteristicBase? GetCharacteristic(string type, ServiceJSON service)
2933
{

0 commit comments

Comments
 (0)