Closed KapJI closed 3 years ago
Hmmmm, the reason I though of adding it is that i have a few chromecasts at home that fail return timers/alarms since they don't have them.
But now that we 'cache' google devices locally and only update that list once in a while (when we need to refresh tokens or on the restart), we could mark those devices as unavailable
as you proposed and skip updating every UPDATE_PERIOD
.
We should not overflow the user with entities that are just listed as unavailable
in HA. This will be confusing for the user.
I think it might be one of the last important things to solve before we can come up with a proper v1 release. What do you guys think?
Maybe we can use this to only get the type of devices we need, without having a hardware list?
EDIT: this change should be made in glocaltokens though
Maybe we can use this to only get the type of devices we need, without having a hardware list?
EDIT: this change should be made in glocaltokens though
This seems like types for generic smart home devices. I didn't find anything related to alarms there.
I think we should use duck typing. If it returns alarms then it's supported.
Just so i understand correctly, you propose to only setup the entities/device if timers/alarms exists? Not just make them unavailable
in HA? 🤔
I guess it depends on the implementation, we can do it either way.
If we can implement it in a way that only creates the device if it is a device that have alarms/timers, then i'm all for removing the list 😄
My reasoning is that, if a user have 5 Chromecast/Android TV's and 5 Google Home devices, we will create a lot of device if we add them all, but only uses half of them. It will confuse and lead to frustration for the end user not knowing why we have created so many device if they can't use them.
btw, android tv devices should support alarms
Oh, i didn't know that 😄
I have an android TV and before we had the hardwarelist implemented, my tv always failed when trying to fetch from it. So we have to look in to that then. EDIT: Because it was not discovered through zeroconf, so it had no IP to try on.
Yeh, unfortunately, i don't think we can use those homegraph docs. Our two probably most possible options I see here are either have and maintain SUPPORT_HARDWARE_LIST
or drop it and in the update cycle:
unavailable
;self.google_devices
(list of devices cached for as long as the tokens are valid ~22h) we loop through devices excluding unavailable
devices and logging those as DEBUG
.
Problem
Maintaining that list is burden you don't really want to have. New devices will be released and other manufacturers will release compatible devices.
Proposal
If device is discovered from Foyer API, it's probably good. Then we can check if it returns alarms list correctly, otherwise mark sensor
unavailable
.