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

2023.5.2 #92610

Merged
merged 20 commits into from May 5, 2023
Merged

2023.5.2 #92610

merged 20 commits into from May 5, 2023

Conversation

balloob
Copy link
Member

@balloob balloob commented May 5, 2023

DDanii and others added 14 commits May 5, 2023 08:46
* transmission error handle fix

* added unexpected case tests
* updated sia requirements

* updates because of changes in package

* linting and other small fixes

* fix for unknown code

* added same to alarm_control_panel
* Improve cloud migration

* Tweak

* Use entity_ids func

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* Do not crash on startup when an invalid cluster handler is encountered

* Add a unit test
…sensor (#92553)

* Allow duplicate states when force_update is set on an esphome sensor

fixes #91221

* Update homeassistant/components/esphome/entry_data.py

Co-authored-by: pdw-mb <pdw@mythic-beasts.com>

---------

Co-authored-by: pdw-mb <pdw@mythic-beasts.com>
* Re-run expose entities migration if first time failed

* Count number of exposed entities

* Add tests

---------

Co-authored-by: Erik <erik@montnemery.com>
* Bump hatasmota to 0.6.5

* Fix tests
@home-assistant home-assistant bot added the merging-to-master This PR is merging into the RC branch and should probably change the branch to `dev`. label May 5, 2023
@bdraco
Copy link
Member

bdraco commented May 5, 2023

If we are waiting for #92617, #92551 is ready now as well

bdraco and others added 6 commits May 5, 2023 14:39
* Improve reliablity of onvif subscription renewals

upstream changelog: hunterjm/python-onvif-zeep-async@v2.0.0...v2.1.0

* ```
Traceback (most recent call last):
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/onvif/client.py", line 75, in _async_wrap_connection_error_retry
    return await func(*args, **kwargs)
  File "/Users/bdraco/home-assistant/homeassistant/components/onvif/event.py", line 441, in _async_call_pullpoint_subscription_renew
    await self._pullpoint_subscription.Renew(SUBSCRIPTION_RELATIVE_TIME)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/zeep/proxy.py", line 64, in __call__
    return await self._proxy._binding.send_async(
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/zeep/wsdl/bindings/soap.py", line 156, in send_async
    response = await client.transport.post_xml(
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/zeep/transports.py", line 235, in post_xml
    response = await self.post(address, message, headers)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/zeep/transports.py", line 220, in post
    response = await self.client.post(
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/httpx/_client.py", line 1845, in post
    return await self.request(
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/httpx/_client.py", line 1530, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/httpx/_client.py", line 1617, in send
    response = await self._send_handling_auth(
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/httpx/_client.py", line 1645, in _send_handling_auth
    response = await self._send_handling_redirects(
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/httpx/_client.py", line 1682, in _send_handling_redirects
    response = await self._send_single_request(request)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/httpx/_client.py", line 1719, in _send_single_request
    response = await transport.handle_async_request(request)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/httpx/_transports/default.py", line 352, in handle_async_request
    with map_httpcore_exceptions():
  File "/opt/homebrew/Cellar/python@3.10/3.10.10_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ReadTimeout
```

* adjust timeouts for slower tplink cameras

* tweak

* more debug

* tweak

* adjust message

* tweak

* Revert "tweak"

This reverts commit 10ee2a8.

* give time in seconds

* revert

* revert

* Update homeassistant/components/onvif/event.py

* Update homeassistant/components/onvif/event.py
* Lower scan interval for opensky to avoid hitting rate limit

* Lower scan interval for opensky to avoid hitting rate limit

* Update homeassistant/components/opensky/sensor.py

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Update homeassistant/components/opensky/sensor.py

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
…92627)

We now let the PullPoint subscription expire instead of explicitly
unsubscribing when pausing the subscription. We will still unsubscribe
it if Home Assistant is shutdown or the integration is reloaded

Some cameras will cancel ALL subscriptions when we do an unsubscribe
so we want to let the PullPoint subscription expire instead
of explicitly cancelling it.
Some cameras do not configure the video source correctly
when using webhooks but work fine with PullPoint which
results in duplicate sensors
@bdraco
Copy link
Member

bdraco commented May 5, 2023

mysql test failure is unrelated. It looks like a race bug in freezegun which is triggered by the logging

023-05-05T19:14:25.4121140Z   File "/home/runner/work/core/core/homeassistant/components/recorder/core.py", line 878, in _guarded_process_one_task_or_recover
2023-05-05T19:14:25.4121566Z     self._process_one_task_or_recover(task)
2023-05-05T19:14:25.4121975Z   File "/home/runner/work/core/core/homeassistant/components/recorder/core.py", line 889, in _process_one_task_or_recover
2023-05-05T19:14:25.4122360Z     return task.run(self)
2023-05-05T19:14:25.4122729Z   File "/home/runner/work/core/core/homeassistant/components/recorder/tasks.py", line 281, in run
2023-05-05T19:14:25.4123113Z     instance._process_one_event(self.event)
2023-05-05T19:14:25.4123529Z   File "/home/runner/work/core/core/homeassistant/components/recorder/core.py", line 1002, in _process_one_event
2023-05-05T19:14:25.4123932Z     self._commit_event_session_or_retry()
2023-05-05T19:14:25.4124341Z   File "/home/runner/work/core/core/homeassistant/components/recorder/core.py", line 1145, in _commit_event_session_or_retry
2023-05-05T19:14:25.4124832Z     self._commit_event_session()
2023-05-05T19:14:25.4125296Z   File "/home/runner/work/core/core/homeassistant/components/recorder/core.py", line 1165, in _commit_event_session
2023-05-05T19:14:25.4125661Z     session.commit()
2023-05-05T19:14:25.4126419Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 1905, in commit
2023-05-05T19:14:25.4126811Z     trans.commit(_to_root=True)
2023-05-05T19:14:25.4127073Z   File "<string>", line 2, in commit
2023-05-05T19:14:25.4127613Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/orm/state_changes.py", line 137, in _go
2023-05-05T19:14:25.4128005Z     ret_value = fn(self, *arg, **kw)
2023-05-05T19:14:25.4128751Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 1220, in commit
2023-05-05T19:14:25.4129161Z     self._prepare_impl()
2023-05-05T19:14:25.4129446Z   File "<string>", line 2, in _prepare_impl
2023-05-05T19:14:25.4129986Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/orm/state_changes.py", line 137, in _go
2023-05-05T19:14:25.4130540Z     ret_value = fn(self, *arg, **kw)
2023-05-05T19:14:25.4131093Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 1195, in _prepare_impl
2023-05-05T19:14:25.4131483Z     self.session.flush()
2023-05-05T19:14:25.4132003Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 4153, in flush
2023-05-05T19:14:25.4132375Z     self._flush(objects)
2023-05-05T19:14:25.4132868Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 4289, in _flush
2023-05-05T19:14:25.4133262Z     with util.safe_reraise():
2023-05-05T19:14:25.4133806Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 147, in __exit__
2023-05-05T19:14:25.4134224Z     raise exc_value.with_traceback(exc_tb)
2023-05-05T19:14:25.4134772Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 4250, in _flush
2023-05-05T19:14:25.4135159Z     flush_context.execute()
2023-05-05T19:14:25.4135887Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/orm/unitofwork.py", line 467, in execute
2023-05-05T19:14:25.4136441Z     rec.execute(self)
2023-05-05T19:14:25.4137157Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/orm/unitofwork.py", line 644, in execute
2023-05-05T19:14:25.4137781Z     util.preloaded.orm_persistence.save_obj(
2023-05-05T19:14:25.4138361Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/orm/persistence.py", line 60, in save_obj
2023-05-05T19:14:25.4138730Z     for (
2023-05-05T19:14:25.4139275Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/orm/persistence.py", line 221, in _organize_states_for_save
2023-05-05T19:14:25.4139738Z     for state, dict_, mapper, connection in _connections_for_states(
2023-05-05T19:14:25.4140375Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/orm/persistence.py", line 1726, in _connections_for_states
2023-05-05T19:14:25.4140883Z     connection = uowtransaction.transaction.connection(base_mapper)
2023-05-05T19:14:25.4141251Z   File "<string>", line 2, in connection
2023-05-05T19:14:25.4141791Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/orm/state_changes.py", line 137, in _go
2023-05-05T19:14:25.4142184Z     ret_value = fn(self, *arg, **kw)
2023-05-05T19:14:25.4142719Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 965, in connection
2023-05-05T19:14:25.4143151Z     return self._connection_for_bind(bind, execution_options)
2023-05-05T19:14:25.4143497Z   File "<string>", line 2, in _connection_for_bind
2023-05-05T19:14:25.4144050Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/orm/state_changes.py", line 137, in _go
2023-05-05T19:14:25.4144447Z     ret_value = fn(self, *arg, **kw)
2023-05-05T19:14:25.4145034Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 1098, in _connection_for_bind
2023-05-05T19:14:25.4145494Z     conn = self._parent._connection_for_bind(bind, execution_options)
2023-05-05T19:14:25.4145831Z   File "<string>", line 2, in _connection_for_bind
2023-05-05T19:14:25.4146383Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/orm/state_changes.py", line 137, in _go
2023-05-05T19:14:25.4146772Z     ret_value = fn(self, *arg, **kw)
2023-05-05T19:14:25.4147465Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 1150, in _connection_for_bind
2023-05-05T19:14:25.4147884Z     transaction = conn.begin()
2023-05-05T19:14:25.4148413Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 849, in begin
2023-05-05T19:14:25.4148979Z     self._transaction = RootTransaction(self)
2023-05-05T19:14:25.4149534Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 2667, in __init__
2023-05-05T19:14:25.4149906Z     self._connection_begin_impl()
2023-05-05T19:14:25.4150473Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 2685, in _connection_begin_impl
2023-05-05T19:14:25.4150889Z     self.connection._begin_impl(self)
2023-05-05T19:14:25.4151436Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1087, in _begin_impl
2023-05-05T19:14:25.4151841Z     self._log_info("BEGIN (implicit)")
2023-05-05T19:14:25.4152382Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 193, in _log_info
2023-05-05T19:14:25.4152803Z     self.engine.logger.info(message, *arg, **kw)
2023-05-05T19:14:25.4153202Z   File "/opt/hostedtoolcache/Python/3.10.11/x64/lib/python3.10/logging/__init__.py", line 1477, in info
2023-05-05T19:14:25.4153566Z     self._log(INFO, msg, args, **kwargs)
2023-05-05T19:14:25.4153938Z   File "/opt/hostedtoolcache/Python/3.10.11/x64/lib/python3.10/logging/__init__.py", line 1622, in _log
2023-05-05T19:14:25.4154346Z     record = self.makeRecord(self.name, level, fn, lno, msg, args,
2023-05-05T19:14:25.4154770Z   File "/opt/hostedtoolcache/Python/3.10.11/x64/lib/python3.10/logging/__init__.py", line 1591, in makeRecord
2023-05-05T19:14:25.4155198Z     rv = _logRecordFactory(name, level, fn, lno, msg, args, exc_info, func,
2023-05-05T19:14:25.4155621Z   File "/opt/hostedtoolcache/Python/3.10.11/x64/lib/python3.10/logging/__init__.py", line 288, in __init__
2023-05-05T19:14:25.4155963Z     ct = time.time()
2023-05-05T19:14:25.4156465Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/freezegun/api.py", line 176, in fake_time
2023-05-05T19:14:25.4156849Z     current_time = get_current_time()
2023-05-05T19:14:25.4157589Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/freezegun/api.py", line 170, in get_current_time
2023-05-05T19:14:25.4158223Z     return freeze_factories[-1]()
2023-05-05T19:14:25.4158588Z IndexError: list index out of range
2023-05-05T19:14:25.4159843Z ERROR:homeassistant.components.recorder.core:SQLAlchemyError error processing task EventTask(event=<Event EVENT_TEST[L]: test_attr=5, test_attr_10=nice>): This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: list index out of range (Background on this error at: https://sqlalche.me/e/20/7s2a)
2023-05-05T19:14:25.4160651Z Traceback (most recent call last):
2023-05-05T19:14:25.4161068Z   File "/home/runner/work/core/core/homeassistant/components/recorder/core.py", line 889, in _process_one_task_or_recover
2023-05-05T19:14:25.4161447Z     return task.run(self)
2023-05-05T19:14:25.4161823Z   File "/home/runner/work/core/core/homeassistant/components/recorder/tasks.py", line 281, in run
2023-05-05T19:14:25.4162214Z     instance._process_one_event(self.event)
2023-05-05T19:14:25.4162631Z   File "/home/runner/work/core/core/homeassistant/components/recorder/core.py", line 1002, in _process_one_event
2023-05-05T19:14:25.4163009Z     self._commit_event_session_or_retry()
2023-05-05T19:14:25.4163431Z   File "/home/runner/work/core/core/homeassistant/components/recorder/core.py", line 1145, in _commit_event_session_or_retry
2023-05-05T19:14:25.4163821Z     self._commit_event_session()
2023-05-05T19:14:25.4164375Z   File "/home/runner/work/core/core/homeassistant/components/recorder/core.py", line 1165, in _commit_event_session
2023-05-05T19:14:25.4165183Z     session.commit()
2023-05-05T19:14:25.4171596Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 1905, in commit
2023-05-05T19:14:25.4172248Z     trans.commit(_to_root=True)
2023-05-05T19:14:25.4172814Z   File "<string>", line 2, in commit
2023-05-05T19:14:25.4173615Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/orm/state_changes.py", line 103, in _go
2023-05-05T19:14:25.4174430Z     self._raise_for_prerequisite_state(fn.__name__, current_state)
2023-05-05T19:14:25.4175105Z   File "/home/runner/work/core/core/venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 905, in _raise_for_prerequisite_state
2023-05-05T19:14:25.4175576Z     raise sa_exc.PendingRollbackError(
2023-05-05T19:14:25.4176815Z sqlalchemy.exc.PendingRollbackError: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: list index out of range (Background on this error at: https://sqlalche.me/e/20/7s2a)

@balloob balloob merged commit e904edb into master May 5, 2023
115 of 117 checks passed
bdraco added a commit that referenced this pull request May 5, 2023
bdraco added a commit that referenced this pull request May 5, 2023
bdraco added a commit that referenced this pull request May 5, 2023
@github-actions github-actions bot locked and limited conversation to collaborators May 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed core has-tests merging-to-master This PR is merging into the RC branch and should probably change the branch to `dev`.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet