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

Update pyialarm to 2.2.0 #74874

Merged
merged 1 commit into from
Jul 11, 2022
Merged

Conversation

RyuzakiKK
Copy link
Contributor

@RyuzakiKK RyuzakiKK commented Jul 10, 2022

Proposed change

Bump pyialarm dependency to the version 2.2.0.

Changes: RyuzakiKK/pyialarm@v1.9.0...v2.2.0

Type of change

(it said to choose just one box, but this is a dependency upgrade that fixes a bug...)

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

To help with the load of incoming pull requests:

Sorry, something went wrong.

@RyuzakiKK
Copy link
Contributor Author

If possible it would be good to include this in the next release 2022.7.3, because unfortunately the upgrade to Python 3.10 is currently preventing this integration to work.

@elupus
Copy link
Contributor

elupus commented Jul 10, 2022

I dont really like the monkeypatching of collections. It affects all other modules in home assistant. I dont have any other easy solution though.

Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dependency bump contains code we cannot accept in our project:

CleanShot 2022-07-10 at 12 22 18@2x

See:

https://github.com/RyuzakiKK/pyialarm/blob/3780178a3349fe725bcc84c8c39cd9eb72b5822c/pyialarm/pyialarm.py#L10-L13

The dependency now will overwrite Python internals, which will affect everything else in this project.

@RyuzakiKK
Copy link
Contributor Author

Hmm, let me check if there is a valid alternative to dicttoxml.

@RyuzakiKK RyuzakiKK force-pushed the bump_pyialarm_2_0_0 branch from a723240 to e5c7902 Compare July 10, 2022 13:42
@RyuzakiKK
Copy link
Contributor Author

I replaced dicttoxml with dicttoxml2. With this one we don't need the workaround anymore.

(pyialarm 2.1.5 also tries to reuse the same connections multiple times and adds a small delay between the requests as this apparently improve reliability)

@MartinHjelmare MartinHjelmare changed the title Update pyialarm to 2.0.0 Update pyialarm to 2.1.5 Jul 10, 2022
@MartinHjelmare
Copy link
Member

We don't want integrations to sleep in our thread pool as it may exhaust the pool:

https://github.com/RyuzakiKK/pyialarm/blob/24bfb08e8ec1c86fc1f50c2ed9fc8ebc0d357da3/pyialarm/pyialarm.py#L91

https://github.com/RyuzakiKK/pyialarm/blob/24bfb08e8ec1c86fc1f50c2ed9fc8ebc0d357da3/pyialarm/pyialarm.py#L148

Sleeping via asyncio is ok, but that requires the library to be changed to use asyncio.

@RyuzakiKK
Copy link
Contributor Author

RyuzakiKK commented Jul 10, 2022

We don't want integrations to sleep in our thread pool as it may exhaust the pool:
Sleeping via asyncio is ok, but that requires the library to be changed to use asyncio.

Yeah, that makes sense.
I'll check tomorrow if that's relatively easy to implement, otherwise I'll first do the switch to dicttoxml2 and then with a future update I'll fix the missing triggered status.

@RyuzakiKK RyuzakiKK force-pushed the bump_pyialarm_2_0_0 branch from e5c7902 to 55134c8 Compare July 11, 2022 08:18
@RyuzakiKK RyuzakiKK changed the title Update pyialarm to 2.1.5 Update pyialarm to 2.2.0 Jul 11, 2022
@RyuzakiKK
Copy link
Contributor Author

I decided to revert the changes to the get_status() function and just switch to dicttoxml2. This will fix the reported issue with Python 3.10.

I didn't want to rush the get_status() changes in (RyuzakiKK/pyialarm#9) because the alarm protocol is very susceptible and I wanted to be more conservative and take some more days to do an endurance test before releasing it.

@frenck frenck added this to the 2022.7.4 milestone Jul 11, 2022
Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @RyuzakiKK 👍

@frenck frenck merged commit fe1c233 into home-assistant:dev Jul 11, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jul 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ialarm: module 'collections' has no attribute 'Iterable'
6 participants