Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add IoTMeter integration #120087
base: dev
Are you sure you want to change the base?
Add IoTMeter integration #120087
Changes from all commits
219bf29
101a412
619bdab
3b92baf
2104ae7
f4f3ae7
5bc25fd
bc913b9
d8d1ba0
b486a82
fc2c055
918b690
cb990bf
6a64052
66d2d84
b58ce55
c138629
b4c7d3c
a21fad8
8356120
6a6735f
a6cd18d
061ed62
8e57087
2095861
4f2a31a
832a7f4
49fe1f0
918435e
942c1b3
25196a5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use entry.runtime_data. Check airgradient for an example. You should extend the ConfigEntry type with the type for the runtime_data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use constants
Check warning on line 47 in homeassistant/components/iotmeter/__init__.py
Codecov / codecov/patch
homeassistant/components/iotmeter/__init__.py#L43-L47
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EV?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add typing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should check if the data is valid. The config flow is the best way to tell the user they did something wrong, so we should try to connect with the device to verify the data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use constants instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if both are required, why do you always use
.get()
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be combined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep this for a follow up PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The coordinator should not be in charge of creating and removing entities. That is the task of
async_setup_entry
in the platform files. Check Withings for an example, the best example in there are the measurement sensorsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only have stuff in the try block that can raise
Check warning on line 59 in homeassistant/components/iotmeter/coordinator.py
Codecov / codecov/patch
homeassistant/components/iotmeter/coordinator.py#L58-L59
Check warning on line 61 in homeassistant/components/iotmeter/coordinator.py
Codecov / codecov/patch
homeassistant/components/iotmeter/coordinator.py#L61
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sounds like some library specific things, can we move this to the library?
Check warning on line 70 in homeassistant/components/iotmeter/coordinator.py
Codecov / codecov/patch
homeassistant/components/iotmeter/coordinator.py#L69-L70
Check warning on line 73 in homeassistant/components/iotmeter/coordinator.py
Codecov / codecov/patch
homeassistant/components/iotmeter/coordinator.py#L72-L73
Check warning on line 95 in homeassistant/components/iotmeter/coordinator.py
Codecov / codecov/patch
homeassistant/components/iotmeter/coordinator.py#L95
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove empty fields
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The library is not licensed properly, please add a valid OSI approved license