diff --git a/custom_components/spotcast/__init__.py b/custom_components/spotcast/__init__.py index 188ff774..46829292 100644 --- a/custom_components/spotcast/__init__.py +++ b/custom_components/spotcast/__init__.py @@ -124,9 +124,9 @@ def websocket_handle_castdevices(hass, connection, msg): _LOGGER.debug("%s", known_devices) resp = [ { - "uuid": cast_info.uuid, - "model_name": cast_info.model_name, - "friendly_name": cast_info.friendly_name, + "uuid": str(cast_info.cast_info.uuid), + "model_name": cast_info.cast_info.model_name, + "friendly_name": cast_info.cast_info.friendly_name, } for cast_info in known_devices ] diff --git a/custom_components/spotcast/manifest.json b/custom_components/spotcast/manifest.json index 0e1e0f22..b2768bca 100644 --- a/custom_components/spotcast/manifest.json +++ b/custom_components/spotcast/manifest.json @@ -7,7 +7,7 @@ "requirements": [ "spotify_token==1.0.0" ], - "version": "v3.6.21", + "version": "v3.6.22", "dependencies": [ "spotify" ], diff --git a/custom_components/spotcast/sensor.py b/custom_components/spotcast/sensor.py index 28ca0fe4..211915be 100755 --- a/custom_components/spotcast/sensor.py +++ b/custom_components/spotcast/sensor.py @@ -38,7 +38,7 @@ def state(self): return self._state @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return self._attributes @@ -50,12 +50,11 @@ def update(self): chromecasts = [ { - "host": "deprecated", - "port": "deprecated", - "uuid": cast_info.uuid, - "model_name": cast_info.model_name, - "name": cast_info.friendly_name, - "manufacturer": cast_info.manufacturer, + "uuid": str(cast_info.cast_info.uuid), + "model_name": cast_info.cast_info.model_name, + "name": cast_info.cast_info.friendly_name, + "manufacturer": cast_info.cast_info.manufacturer, + "cast_type": cast_info.cast_info.cast_type, } for cast_info in known_devices ] @@ -82,7 +81,7 @@ def state(self): return self._state @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return self._attributes diff --git a/custom_components/spotcast/spotcast_controller.py b/custom_components/spotcast/spotcast_controller.py index abac2b31..28131e8c 100644 --- a/custom_components/spotcast/spotcast_controller.py +++ b/custom_components/spotcast/spotcast_controller.py @@ -68,7 +68,7 @@ def getChromecastDevice(self, device_name): _LOGGER.debug("cast info: %s", cast_info) if cast_info: return pychromecast.get_chromecast_from_cast_info( - cast_info, ChromeCastZeroconf.get_zeroconf() + cast_info.cast_info, ChromeCastZeroconf.get_zeroconf() ) _LOGGER.error( "Could not find device %s from hass.data", diff --git a/hacs.json b/hacs.json index b687e392..1b9ed243 100644 --- a/hacs.json +++ b/hacs.json @@ -1,6 +1,6 @@ { "name": "Spotcast", "domains": ["media_player", "sensor"], - "homeassistant": "2021.4.1", + "homeassistant": "2021.12.0", "iot_class": ["Cloud Polling"] }