pnbruckner/ha-sun2

Getting errors in my logs from the Sun2 component

julianrinaldi opened this issue · 1 comments

Here are my environment settings, and the errors I'm receiving below:

System Health

version core-2021.6.6
installation_type Home Assistant Core
dev false
hassio false
docker false
virtualenv true
python_version 3.9.0
os_name Darwin
os_version 10.16
arch x86_64
timezone America/New_York
Home Assistant Community Store
GitHub API ok
Github API Calls Remaining 4278
Installed Version 1.13.2
Stage running
Available Repositories 856
Installed Repositories 94
Home Assistant Cloud
logged_in true
subscription_expiration July 16, 2021, 8:00 PM
relayer_connected true
remote_enabled true
remote_connected true
alexa_enabled true
google_enabled false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Lovelace
dashboards 4
resources 54
views 24
mode storage
Spotify
api_endpoint_reachable ok
Logger: homeassistant.components.sensor
Source: custom_components/sun2/sensor.py:43
Integration: Sensor (documentation, issues)
First occurred: 3:50:41 PM (2 occurrences)
Last logged: 3:50:41 PM

Error adding entities for domain sensor with platform sun2
Error while setting up sun2 platform for sensor
Traceback (most recent call last):
  File "/Users/homeassistant/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/entity_platform.py", line 383, in async_add_entities
    await asyncio.gather(*tasks)
  File "/Users/homeassistant/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/entity_platform.py", line 588, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/Users/homeassistant/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/entity.py", line 614, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/Users/homeassistant/.homeassistant/custom_components/sun2/sensor.py", line 158, in async_added_to_hass
    self._setup_fixed_updating()
  File "/Users/homeassistant/.homeassistant/custom_components/sun2/sensor.py", line 130, in _setup_fixed_updating
    next_midn = next_midnight(dt_util.now(self._tzinfo))
  File "/Users/homeassistant/.homeassistant/custom_components/sun2/sensor.py", line 43, in next_midnight
    return dt.tzinfo.localize(datetime.combine(dt.date() + _ONE_DAY, time()))
AttributeError: 'zoneinfo.ZoneInfo' object has no attribute 'localize'
Logger: homeassistant.util.logging
Source: util/logging.py:105
First occurred: 3:53:00 PM (42 occurrences)
Last logged: 3:53:17 PM

Exception in async_loc_updated when dispatching 'sun2_loc_updated': () Traceback (most recent call last): File "/Users/homeassistant/.homeassistant/custom_components/sun2/sensor.py", line 145, in async_loc_updated self._loc_updated() File "/Users/homeassistant/.homeassistant/custom_components/sun2/sensor.py", line 140, in _loc_updated self._setup_fixed_updating() File "/Users/homeassistant/.homeassistant/custom_components/sun2/sensor.py", line 130, in _setup_fixed_updating next_midn = next_midnight(dt_util.now(self._tzinfo)) File "/Users/homeassistant/.homeassistant/custom_components/sun2/sensor.py", line 43, in next_midnight return dt.tzinfo.localize(datetime.combine(dt.date() + _ONE_DAY, time())) AttributeError: 'zoneinfo.ZoneInfo' object has no attribute 'localize'

Closed. Sorry, I thought I was on the latest version which fixed the issue.