IATkachenko / HA-SleepAsAndroid

Sleep As Android integration for Home Assistant
Apache License 2.0
165 stars 25 forks source link

Fails to start with Home Assistant 2022.3.0b5 (unexpected keyword argument 'new_state') #39

Closed Steltek closed 2 years ago

Steltek commented 2 years ago

General information

Home Assistant

Version: 2022.3.0b5 Installation method (according to instructions): [X] Operating System [ ] Container [ ] Supervised [ ] Core

Integration

Installation method: [X] HACS [ ] manual from release [ ] manual from git Integration version: v1.8.2 Root topic:

Application settings

topic: [X] I can see MQTT messages from application at MQTT-server

How it works now?

The integration used to work. (MQTT broker settings etc all fine and have not changed.)

Upon startup, the integration errors out with "TypeError: async_subscribe_topics() got an unexpected keyword argument 'new_state'"

Debug log

2022-03-01 14:18:50 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up sleep_as_android platform for sensor
Traceback (most recent call last):
  File "/hass/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
    await asyncio.shield(task)
  File "/hass/.homeassistant/custom_components/sleep_as_android/sensor.py", line 48, in async_setup_entry
    await instance.subscribe_root_topic(async_add_entities)
  File "/hass/.homeassistant/custom_components/sleep_as_android/__init__.py", line 257, in subscribe_root_topic
    self._subscription_state = await subscribe_2021_07(
  File "/hass/.homeassistant/custom_components/sleep_as_android/__init__.py", line 235, in subscribe_2021_07
    return await subscription.async_subscribe_topics(
TypeError: async_subscribe_topics() got an unexpected keyword argument 'new_state'

Additional information

IATkachenko commented 2 years ago

Thank you for report. Will check it. Looks like version comparison goes bad :(

IATkachenko commented 2 years ago

Nice

f"{ha_version.version} >= {AwesomeVersion('2022.3.0')} is {ha_version.version >= AwesomeVersion('2022.3.0')}"
 2022.3.0b5 >= 2022.3.0 is False

I should read documentation carefully...

IATkachenko commented 2 years ago

Only 2022.3.0 beta installations affected. Will fix soon.

IATkachenko commented 2 years ago

Fixed in v1.8.3. Because only beta version was affected this release will be marked as pre-release and will be available only if "get beta version" option is turned on for the integration in HACS.