leikoilja / ha-google-home

Home Assistant Google Home custom component
MIT License
428 stars 72 forks source link

Get rid of SUPPORTED_HARDWARE_LIST #71

Closed KapJI closed 3 years ago

KapJI commented 3 years ago

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.

leikoilja commented 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.

DurgNomis-drol commented 3 years ago

We should not overflow the user with entities that are just listed as unavailable in HA. This will be confusing for the user.

leikoilja commented 3 years ago

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?

DurgNomis-drol commented 3 years ago

Homegraph

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

KapJI commented 3 years ago

Homegraph

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.

DurgNomis-drol commented 3 years ago

Just so i understand correctly, you propose to only setup the entities/device if timers/alarms exists? Not just make them unavailable in HA? 🤔

KapJI commented 3 years ago

I guess it depends on the implementation, we can do it either way.

DurgNomis-drol commented 3 years ago

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.

KapJI commented 3 years ago

btw, android tv devices should support alarms

DurgNomis-drol commented 3 years ago

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.

leikoilja commented 3 years ago

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: