ludeeus / googledevices

Get information from, and control various Google devices.
https://pypi.org/project/googledevices/
MIT License
20 stars 4 forks source link

Restructure #36

Closed ludeeus closed 5 years ago

ludeeus commented 5 years ago

closes #35

Test of all classes after this restructure:

Testing Cast.
Testing Cast - Alarm.
Testing Cast - Alarm - get_alarms
{
    "alarm": [],
    "timer": []
}
Testing Cast - Alarm - set_alarm_volume
true
Testing Cast - Alarm - get_alarm_volume
{
    "volume": 0.6000000238418579
}
Testing Cast - Bluetooth.
Testing Cast - Bluetooth - get_bluetooth_status
{
    "audio_mode": 1,
    "connected_devices": [],
    "connecting_devices": [],
    "discovery_enabled": false,
    "scanning_enabled": false
}
Testing Cast - Bluetooth - set_discovery_enabled
true
Testing Cast - Bluetooth - scan_for_devices
true
Testing Cast - Bluetooth - get_scan_result
[
    {
        "device_class": 0,
        "device_type": 3,
        "expected_profiles": 0,
        "mac_address": "9c:20:7b:9c:5a:ba",
        "name": "",
        "rssi": -59
    }
]
Testing Cast - Info.
Testing Cast - Info - get_device_info
{
    "audio": {
        "digital": false
    },
    "build_info": {
        "build_type": 2,
        "cast_build_revision": "1.36.141215",
        "cast_control_version": 1,
        "preview_channel_state": 4,
        "release_track": "preview-joining-stable-channel",
        "system_build_number": "141215"
    },
    "detail": {
        "icon_list": [
            {
                "depth": 32,
                "height": 55,
                "mimetype": "image/png",
                "url": "/setup/icon.png",
                "width": 98
            }
        ],
        "locale": {
            "display_string": "English (United States)"
        },
        "timezone": {
            "display_string": "Central European Standard Time (Oslo)",
            "offset": 60
        }
    },
    "device_info": {
        "4k_blocked": 0,
        "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,
            "multizone_supported": true,
            "night_mode_supported": true,
            "night_mode_supported_v2": true,
            "opencast_supported": true,
            "preview_channel_supported": true,
            "reboot_supported": true,
            "remote_ducking_supported": true,
            "setup_supported": true,
            "sleep_mode_supported": true,
            "stats_supported": true,
            "system_sound_effects_supported": false,
            "ui_flipping_supported": true,
            "user_eq_supported": true,
            "wifi_auto_save_supported": true,
            "wifi_regulatory_domain_locked": true,
            "wifi_supported": true
        },
        "cloud_device_id": "7610275D05C2DEBF6E808EEF685ECF0C",
        "factory_country_code": "US",
        "hotspot_bssid": "FA:8F:CA:7F:E4:C6",
        "local_authorization_token_hash": "akB/Tv7R2bOia2kQt6I2M42Q/YmP4mI0vdFl1Tku4Bg=",
        "mac_address": "20:DF:B9:62:EE:AC",
        "manufacturer": "Google Inc.",
        "model_name": "Google Home Mini",
        "product_name": "mushroom",
        "public_key": "MIIBCgKCAQEA2rJD49tgHfJai7UJKs9G7OGjs6FLFgpfj2A5JwpJsCwzAfHmDxjv8VcuZNO0l2D463TWRjj8AWiinphb16tTPPsXL5ktZkOlXNtFno+9dC/UzEY4YwhGSyVRQA5+SFlsd0JS5Q6K0zOCvHVkFCOTAhg5P7ZcpKw4mq6XSTaaC2298g4/m1A4zxX8PZN/TOXRBBV4zT4JrINluZfvXoNZMgcVJA4UkKI8xNknA8b68NGr12Fx665+D4Ak2y4ZCUe0PHIy2otCbT3yEvtkvKWT8lshWl/gsm3whvfEkPhBMwE3PQE1Jn8E0PzH9vrPv8GesR0EkJ/KvFZ5luyW2gx1nQIDAQAB",
        "ssdp_udn": "8c045149-6055-4e37-56a6-64e64c1584bf",
        "uma_client_id": "4c59bd8e-efd0-4ea8-9635-4de8399d5d06",
        "uptime": 238.540961
    },
    "multizone": {
        "audio_output_delay": 0.0,
        "audio_output_delay_hdmi": 0.0,
        "audio_output_delay_oem": 0.0,
        "aux_in_group": "",
        "groups": [
            {
                "cast_port": 42342,
                "channel_selection": "",
                "elected_leader": "self",
                "leader": "",
                "multichannel_group": false,
                "name": "mini",
                "stereo_balance": 0.0,
                "uuid": "4BD81E86-DE1B-4340-ADA9-EB65526090AF"
            }
        ],
        "multichannel_status": 0
    },
    "name": "Living Room",
    "net": {
        "ethernet_connected": false,
        "ip_address": "192.168.2.241",
        "online": true
    },
    "night_mode_params": {
        "device_override_do_not_disturb": 0,
        "do_not_disturb": true,
        "enabled": true,
        "led_brightness": 0.5,
        "volume": 0.4,
        "windows": [
            {
                "days": [
                    0,
                    5,
                    1,
                    6,
                    2,
                    3,
                    4
                ],
                "length_hours": 8.0,
                "start_hour": 22.0
            }
        ]
    },
    "opencast": {
        "pin_code": "2465"
    },
    "opt_in": {
        "audio_hdr": false,
        "audio_surround_mode": 0,
        "autoplay_on_signal": true,
        "cloud_ipc": true,
        "hdmi_prefer_50hz": false,
        "hdmi_prefer_high_fps": true,
        "managed_mode": false,
        "opencast": true,
        "preview_channel": true,
        "remote_ducking": true,
        "stats": true,
        "ui_flipped": false
    },
    "proxy": {
        "mode": "system"
    },
    "settings": {
        "closed_caption": {},
        "control_notifications": 2,
        "country_code": "NO",
        "locale": "en-US",
        "network_standby": 0,
        "system_sound_effects": true,
        "time_format": 2,
        "timezone": "Europe/Oslo",
        "wake_on_cast": 1
    },
    "setup": {
        "setup_state": 60,
        "ssid_suffix": "o",
        "stats": {
            "num_check_connectivity": 0,
            "num_connect_wifi": 0,
            "num_connected_wifi_not_saved": 0,
            "num_initial_eureka_info": 0,
            "num_obtain_ip": 0
        },
        "tos_accepted": true
    },
    "user_eq": {
        "high_shelf": {
            "frequency": 4500,
            "gain_db": 0,
            "quality": 0.707
        },
        "low_shelf": {
            "frequency": 150,
            "gain_db": 1,
            "quality": 0.707
        },
        "max_peaking_eqs": 0,
        "peaking_eqs": []
    },
    "version": 9,
    "wifi": {
        "bssid": "7c:2e:bd:98:1b:02",
        "has_changes": false,
        "noise_level": -89,
        "signal_level": -55,
        "ssid": "NETT",
        "wpa_configured": true,
        "wpa_id": 0,
        "wpa_state": 10
    }
}
Testing Cast - Settings.
Testing Cast - Settings - control_notifications
true
Testing Cast - Settings - set_eureka_info
true
Testing Cast - Settings - reboot
true
Testing WiFi.
Testing WiFi - Info.
Testing WiFi - Info - get_host
"192.168.2.1"
Testing WiFi - Info - get_host - with host not defined.
"192.168.2.1"
Testing WiFi - Info - get_wifi_info
{
    "software": {
        "softwareVersion": "10718.111.0",
        "updateChannel": "stable-channel",
        "updateNewVersion": "0.0.0.0",
        "updateProgress": 0.0,
        "updateRequired": false,
        "updateStatus": "idle"
    },
    "system": {
        "countryCode": "nl",
        "groupRole": "none",
        "hardwareId": "GALE C2I-A2A-A3C-A4I-U73",
        "lan0Link": true,
        "modelId": "ACc3d",
        "uptime": 1284635
    },
    "vorlonInfo": {
        "migrationMode": "vorlon_all"
    },
    "wan": {
        "captivePortal": false,
        "ethernetLink": true,
        "gatewayIpAddress": "192.168.1.1",
        "invalidCredentials": false,
        "ipAddress": true,
        "ipMethod": "dhcp",
        "ipPrefixLength": 24,
        "leaseDurationSeconds": 86400,
        "localIpAddress": "192.168.1.2",
        "nameServers": [
            "8.8.8.8",
            "8.8.4.4",
            "192.168.2.200",
            "1.1.1.1"
        ],
        "online": true,
        "pppoeDetected": false
    }
}
Testing WiFi - Clients.
Testing WiFi - Clients - get_clients
[
    {
        "ip": "192.168.1.184",
        "mac": "00000015ca80"
    },
    {
        "ip": "192.168.2.180",
        "mac": "000c29fbb078"
    },
    {
        "ip": "192.168.1.1",
        "mac": "60a44c27f451"
    },
    {
        "ip": "192.168.2.101",
        "mac": "a4773349adc5"
    },
    {
        "ip": "192.168.2.200",
        "mac": "000c297506c2"
    },
    {
        "ip": "192.168.1.141",
        "mac": "00000015ca80"
    },
    {
        "ip": "192.168.2.241",
        "mac": "20dfb9c54c69"
    },
    {
        "ip": "192.168.2.110",
        "mac": "2c56dc8f2d5f"
    },
    {
        "ip": "192.168.1.25",
        "mac": "00000015ca80"
    },
    {
        "ip": "192.168.1.151",
        "mac": "b4b6763174a7"
    },
    {
        "ip": "192.168.2.237",
        "mac": "b827ebd279ca"
    },
    {
        "ip": "192.168.2.106",
        "mac": "94103e303794"
    },
    {
        "ip": "192.168.1.106",
        "mac": "00000015ca80"
    },
    {
        "ip": "192.168.2.201",
        "mac": "70480f227059"
    },
    {
        "ip": "192.168.2.102",
        "mac": "2c3ae8cdf2fd"
    },
    {
        "ip": "192.168.1.239",
        "mac": "9c207bd568e5"
    },
    {
        "ip": "192.168.2.242",
        "mac": "3ccd938325aa"
    },
    {
        "ip": "169.254.174.92",
        "mac": "0028f887facf"
    },
    {
        "ip": "192.168.2.107",
        "mac": "00a0de857fed"
    },
    {
        "ip": "192.168.2.6",
        "mac": "000c2916bd11"
    },
    {
        "ip": "192.168.2.108",
        "mac": "686359eb547f"
    },
    {
        "ip": "192.168.2.11",
        "mac": "000c29b45a97"
    },
    {
        "ip": "192.168.2.238",
        "mac": "70ee5029e85d"
    },
    {
        "ip": "192.168.2.202",
        "mac": "70ee505ddfa6"
    },
    {
        "ip": "192.168.2.2",
        "mac": "10ddb1d6e5b9"
    },
    {
        "ip": "192.168.2.243",
        "mac": "70ee5029e85d"
    },
    {
        "ip": "192.168.2.104",
        "mac": "44070b5926af"
    },
    {
        "ip": "192.168.2.109",
        "mac": "4409b87ff981"
    },
    {
        "ip": "192.168.2.239",
        "mac": "0028f887facf"
    },
    {
        "ip": "192.168.2.100",
        "mac": "48bf6bb65879"
    },
    {
        "ip": "192.168.2.203",
        "mac": "70ee505ddfa6"
    },
    {
        "ip": "192.168.2.230",
        "mac": "0028f887facf"
    },
    {
        "ip": "192.168.2.105",
        "mac": "20dfb9c54c69"
    },
    {
        "ip": "169.254.216.173",
        "mac": "2c56dc8f2d5f"
    },
    {
        "ip": "192.168.2.240",
        "mac": "3ccd938325aa"
    },
    {
        "ip": "192.168.2.123",
        "mac": "001132cc3306"
    },
    {
        "ip": "192.168.2.204",
        "mac": "70ee5029e85d"
    },
    {
        "ip": "192.168.2.124",
        "mac": "000c299824ca"
    }
]
TESTS COMPLETE.