Skip to content

Commit

Permalink
fix: replace deprecated async_get_registry while sensor setup by asyn…
Browse files Browse the repository at this point in the history
…c_get

async_get_registry for device_registry is just wrapper for async_get, so we may use it directly.

Fix #43
  • Loading branch information
IATkachenko committed May 25, 2022
1 parent ecaed5d commit f42ea63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/sleep_as_android/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ async def async_added_to_hass(self):
Should create device for sensor here
"""
await super().async_added_to_hass()
device_registry = await dr.async_get_registry(self.hass)
device_registry = dr.async_get(self.hass)
device = device_registry.async_get_device(
identifiers=self.device_info["identifiers"], connections=set()
)
Expand Down

0 comments on commit f42ea63

Please sign in to comment.