Skip to content

Remove dead code in fibaro light#106890

Merged
frenck merged 1 commit intohome-assistant:devfrom
rappenze:remove_dead_code_in_fibaro_light
Jan 4, 2024
Merged

Remove dead code in fibaro light#106890
frenck merged 1 commit intohome-assistant:devfrom
rappenze:remove_dead_code_in_fibaro_light

Conversation

@rappenze
Copy link
Copy Markdown
Contributor

@rappenze rappenze commented Jan 2, 2024

Proposed change

Remove synchronization in fibaro light as it is not needed (anymore). I'm not sure why it was initially implemented but I tested it thoroughly and didn't find any reason for it.

Additionally it was needed to pass parameters to call_set_color in a different way because of mypy checks.

Type of change

  • 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

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

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
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format 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.

To help with the load of incoming pull requests:

Copy link
Copy Markdown
Contributor

@HipsterBrown HipsterBrown left a comment

Choose a reason for hiding this comment

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

Remove synchronization in fibaro light as it is not needed (anymore). I'm not sure why it was initially implemented but I tested it thoroughly and didn't find any reason for it.

Based on other feedback I've gotten, since the pyfibaro action are blocking network I/O via the requests package, those actions should be deferred to the async executor to avoid blocking the event loop.

Copy link
Copy Markdown
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, @rappenze 👍

../Frenck

@frenck frenck merged commit 254abee into home-assistant:dev Jan 4, 2024
@MartinHjelmare
Copy link
Copy Markdown
Member

MartinHjelmare commented Jan 4, 2024

Here's the explanation when the lock was added:
#18622 (comment)

Is that no longer the case?

@rappenze
Copy link
Copy Markdown
Contributor Author

rappenze commented Jan 4, 2024

Here's the explanation when the lock was added: #18622 (comment)

Is that no longer the case?

This is no longer the case, in turn_on there is no case anymore which executes 2 requests so this change is safe.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 5, 2024
@rappenze rappenze deleted the remove_dead_code_in_fibaro_light branch July 7, 2024 17:35
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.

4 participants