Improve Home Assistant connection reliability

This commit is contained in:
2026-07-27 16:23:40 -07:00
parent b7ec774efd
commit f3341ee064
16 changed files with 1696 additions and 697 deletions

View File

@@ -35,14 +35,12 @@ extension Device where Self: Hashable
{
func hash(into hasher: inout Hasher)
{
hasher.combine(self.name)
hasher.combine(self.type)
hasher.combine(self.serial)
}
static func == (lhs: Self, rhs: Self) -> Bool
{
return lhs.name == rhs.name && lhs.serial == rhs.serial
return lhs.serial == rhs.serial
}
}

View File

@@ -43,7 +43,10 @@ extension HubitatDevice : Decodable
name = try values.decode(String.self, forKey: .name)
let attributes = try values.nestedContainer(keyedBy: Self.AttributesKeys, forKey: .attributes)
let attributes = try values.nestedContainer(
keyedBy: Self.AttributesKeys.self,
forKey: .attributes
)
state = try attributes.decode(DeviceState.self, forKey: .switch)
}
}