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

Sourcery refactored main branch #3

Closed
wants to merge 1 commit into from
Closed

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Nov 29, 2023

Branch main refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the main branch, then run:

git fetch origin sourcery/main
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

attributes = {
return {
Copy link
Author

Choose a reason for hiding this comment

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

Function HomeLINKProperty.extra_state_attributes refactored with the following changes:

Comment on lines -239 to +258
self._parent_key in coordinator.data[COORD_PROPERTIES]
and self._key
in coordinator.data[COORD_PROPERTIES][self._parent_key][COORD_DEVICES]
self._parent_key not in coordinator.data[COORD_PROPERTIES]
or self._key
not in coordinator.data[COORD_PROPERTIES][self._parent_key][
COORD_DEVICES
]
):
for reading in coordinator.data[COORD_PROPERTIES][self._parent_key][
COORD_READINGS
]:
if reading.type != self._readingtype:
return
for reading in coordinator.data[COORD_PROPERTIES][self._parent_key][
COORD_READINGS
]:
if reading.type != self._readingtype:
continue
for device in reading.devices:
if device.serialnumber != self._key:
continue
for device in reading.devices:
if device.serialnumber != self._key:
continue
self._state = device.values[len(device.values) - 1].value
self._readingdate = device.values[
len(device.values) - 1
].readingdate
break
self._state = device.values[len(device.values) - 1].value
self._readingdate = device.values[
len(device.values) - 1
].readingdate
break
Copy link
Author

Choose a reason for hiding this comment

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

Function HomeLINKReadingSensor._initial_attributes refactored with the following changes:

Comment on lines -260 to +263
attributes = read_state(self.hass, self.device_class, self._key)
if attributes:
if attributes := read_state(self.hass, self.device_class, self._key):
Copy link
Author

Choose a reason for hiding this comment

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

Function HomeLINKReadingSensor.async_added_to_hass refactored with the following changes:

Comment on lines -35 to -36
if not device_id:
pass
Copy link
Author

Choose a reason for hiding this comment

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

Function build_device_identifiers refactored with the following changes:

@RogerSelwyn RogerSelwyn deleted the sourcery/main branch January 2, 2024 22:50
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 this pull request may close these issues.

1 participant