iprak / weatherapi

HomeAssistant custom integration to fetch data from weatherapi
MIT License
8 stars 3 forks source link

Use DeviceEntryType instead of str for device registry entry_type #6

Closed iprak closed 2 years ago

iprak commented 2 years ago

Running against current dev stream generates this error

2021-11-26 19:58:07 WARNING (MainThread) [homeassistant.helpers.frame] Detected code that uses str for device registry entry_type. This is deprecated, it should be updated to use DeviceEntryType instead. Please report this issue.
Stack (most recent call last):
  File "/usr/local/python/bin/hass", line 8, in <module>
    sys.exit(main())
  File "/usr/local/python/lib/python3.9/site-packages/homeassistant/__main__.py", line 318, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/local/python/lib/python3.9/site-packages/homeassistant/runner.py", line 121, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/python/lib/python3.9/asyncio/base_events.py", line 629, in run_until_complete
    self.run_forever()
  File "/usr/local/python/lib/python3.9/asyncio/base_events.py", line 596, in run_forever
    self._run_once()
  File "/usr/local/python/lib/python3.9/asyncio/base_events.py", line 1890, in _run_once
    handle._run()
  File "/usr/local/python/lib/python3.9/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/python/lib/python3.9/site-packages/homeassistant/helpers/entity_platform.py", line 499, in _async_add_entity
    device = device_registry.async_get_or_create(**processed_dev_info)  # type: ignore[arg-type]
  File "/usr/local/python/lib/python3.9/site-packages/homeassistant/helpers/device_registry.py", line 356, in async_get_or_create
    report(  # type: ignore[unreachable]
  File "/usr/local/python/lib/python3.9/site-packages/homeassistant/helpers/frame.py", line 71, in report
    _LOGGER.warning(msg, stack_info=True)
Stack (most recent call last):
  File "/usr/local/python/bin/hass", line 8, in <module>
    sys.exit(main())
  File "/usr/local/python/lib/python3.9/site-packages/homeassistant/__main__.py", line 318, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/local/python/lib/python3.9/site-packages/homeassistant/runner.py", line 121, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/python/lib/python3.9/asyncio/base_events.py", line 629, in run_until_complete
    self.run_forever()
  File "/usr/local/python/lib/python3.9/asyncio/base_events.py", line 596, in run_forever
    self._run_once()
  File "/usr/local/python/lib/python3.9/asyncio/base_events.py", line 1890, in _run_once
    handle._run()
  File "/usr/local/python/lib/python3.9/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/python/lib/python3.9/site-packages/homeassistant/helpers/entity_platform.py", line 499, in _async_add_entity
    device = device_registry.async_get_or_create(**processed_dev_info)  # type: ignore[arg-type]
  File "/usr/local/python/lib/python3.9/site-packages/homeassistant/helpers/device_registry.py", line 356, in async_get_or_create
    report(  # type: ignore[unreachable]
  File "/usr/local/python/lib/python3.9/site-packages/homeassistant/helpers/frame.py", line 71, in report
    _LOGGER.warning(msg, stack_info=True)

Associated PRs: https://github.com/home-assistant/core/pull/58646, https://github.com/home-assistant/core/pull/59940