Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature - Check if device is compatible through eureka endpoint #220

Open
DurgNomis-drol opened this issue Apr 18, 2021 · 3 comments
Open
Labels
feature New feature or request refactoring Refactoring

Comments

@DurgNomis-drol
Copy link
Collaborator

DurgNomis-drol commented Apr 18, 2021

Actually even if the devices returns a 200 for eureka_info, there is no guaranty that the device supports alarms or timers, we still would need to check assistant_supported. This can also come in handy in the future where we can check what other features is supported.

The check should probably be a combination of both like this:

  1. Request eureka_info if 404 return device not compatible. Else continue check.
  2. Check if assistant_supported is true, return device is compatible. If false return device is not compatible.

Originally posted by @DurgNomis-drol in #212 (comment)

eureka_info example:

"device_info": {
  "capabilities": {
    "aogh_supported": true,
    "assistant_supported": true,
    "audio_hdr_supported": false,
    "audio_surround_mode_supported": false,
    "ble_supported": true,
    "bluetooth_audio_sink_supported": true,
    "bluetooth_audio_source_supported": true,
    "bluetooth_supported": true,
    "cloudcast_supported": true,
    "content_filters_supported": true,
    "display_supported": false,
    "fdr_supported": false,
    "hdmi_prefer_50hz_supported": false,
    "hdmi_prefer_high_fps_supported": false,
    "hotspot_supported": true,
    "https_setup_supported": true,
    "input_management_supported": true,
    "keep_hotspot_until_connected_supported": true,
    "multi_user_supported": true,
    "multichannel_group_supported": true,
    "multizone_supported": true,
    "night_mode_supported": true,
    "night_mode_supported_v2": true,
    "opencast_supported": false,
    "preview_channel_supported": true,
    "reboot_supported": true,
    "remote_ducking_supported": true,
    "separate_tts_volume_supported": true,
    "setup_supported": true,
    "sleep_mode_supported": true,
    "stats_supported": true,
    "system_sound_effects_supported": false,
    "user_eq_supported": true,
    "wifi_auto_save_supported": true,
    "wifi_regulatory_domain_locked": true,
    "wifi_supported": true
    },
}
@DurgNomis-drol DurgNomis-drol added feature New feature or request refactoring Refactoring labels Apr 18, 2021
@KapJI
Copy link
Collaborator

KapJI commented Apr 18, 2021

If eureka_info is 200, we should create device sensor. If assistant_supported is true we should also create alarms and timers sensors and do not disturb switch.

@leikoilja
Copy link
Owner

Great idea! That exactly what i was thinking in earlier discussions, we could probably take a step backwards and implement it in the following manner:

  • Request devices from foyer (glocaltokens)
  • Initialize GoogleHomeDevice as we currently do in model per device
  • Do eureka call to populate GoogleHomeDevice objects with necessary information (like capabilities) etc. (that can be expanded over time i guess
  • Initialize HA sensors/services based on those object arguments stated in GoogleHomeDevice objects

@stboch
Copy link

stboch commented Apr 19, 2021

yup also the reboot device function can be based on reboot_supported. A stub for future Bluetooth work based on ble_supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request refactoring Refactoring
Projects
None yet
Development

No branches or pull requests

4 participants