Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

daikin_brp069 modifies class constant on init #46

Open
danharvey opened this issue Jan 6, 2025 · 0 comments · May be fixed by #47
Open

daikin_brp069 modifies class constant on init #46

danharvey opened this issue Jan 6, 2025 · 0 comments · May be fixed by #47

Comments

@danharvey
Copy link

Whilst testing an issue with home assistant home-assistant/core#134934 I found that for updates the resources called was growing:

2025-01-06 21:12:19.805 DEBUG (MainThread) [pydaikin.daikin_base] Updating ['aircon/get_sensor_info', 'aircon/get_control_info', 'aircon/get_day_power_ex', 'aircon/get_week_power', 'aircon/get_day_power_ex', 'aircon/get_week_power', 'aircon/get_day_power_ex', 'aircon/get_week_power', 'aircon/get_day_power_ex', 'aircon/get_week_power', 'aircon/get_day_power_ex', 'aircon/get_week_power', 'aircon/get_day_power_ex', 'aircon/get_week_power']

I think this may be sometimes if startup is slow, init may get call multiple times:

image

This is caused by addition to the class constant in the init method:

async def init(self):
"""Init status."""
await self.auto_set_clock()
if self.values:
await self.update_status(self.HTTP_RESOURCES[1:])
else:
await self.update_status(self.HTTP_RESOURCES)
if self.support_energy_consumption:
self.INFO_RESOURCES += [ # pylint: disable=invalid-name
'aircon/get_day_power_ex',
'aircon/get_week_power',
]

@danharvey danharvey linked a pull request Jan 6, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant