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
EnergyID integration #95006
EnergyID integration #95006
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
1 similar comment
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
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.
Some initial feedback to get the process started. I haven't worked with webhooks yet, so I will leave the feedback for that open for someone else to pick up
{ | ||
"domain": "energyid", | ||
"name": "EnergyID", | ||
"integrations": ["energyid"] | ||
} |
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.
A brand is only created if there are more integrations under 1 company brand. For example Google has everything from Google Agenda to YouTube and Philips has Philips hue and Philips TV. So this integration is not a brand.
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.
I understand. So this json file can simply be removed?
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.
Yes
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.
Still not removed btw
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
@@ -342,6 +342,7 @@ build.json @home-assistant/supervisor | |||
/tests/components/emulated_kasa/ @kbickar | |||
/homeassistant/components/energy/ @home-assistant/core | |||
/tests/components/energy/ @home-assistant/core | |||
/homeassistant/components/energyid/ @JrtPec |
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.
Hmm, the tests should also be added to your name. I think hassfest might be having a bad day with it (I also saw another case of this recently, so maybe its something we have to fix in hassfest)
@@ -342,6 +342,7 @@ build.json @home-assistant/supervisor | |||
/tests/components/emulated_kasa/ @kbickar | |||
/homeassistant/components/energy/ @home-assistant/core | |||
/tests/components/energy/ @home-assistant/core | |||
/homeassistant/components/energyid/ @JrtPec |
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.
/homeassistant/components/energyid/ @JrtPec | |
/homeassistant/components/energyid/ @JrtPec | |
/tests/components/energyid/ @JrtPec |
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.
1 remark and 1 suggestion. Reading the code this time actually make me realise what the integration does. I will ask some other members if this approach is the way to go or if there are any reasons it should be different
await dispatcher.client.get_policy() | ||
except aiohttp.ClientResponseError as error: | ||
_LOGGER.error("Could not validate webhook client") | ||
raise ConfigEntryAuthFailed from error |
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.
ConfigEntryAuthFailed
should only be raised when the integration has a reauth flow and you dont have one yet. So please raise ConfigEntryError
instead
|
||
async def async_handle_state_change(self, event: Event) -> bool: | ||
"""Handle a state change.""" | ||
await self._upload_lock.acquire() |
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.
Would it maybe work if you did:
async with self._upload_lock:
This way you don't have to manually acquire and release locks. (and if you dislike the extra indent, you could move this function to _async_handle_state_change
and call it like
async def async_handle_state_change() -> bool:
async with self._upload_lock:
await self._async_handle_state_change()
Oh and sorry for the wait |
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
Proposed change
Introducing the EnergyID integration! EnergyID is an online energy monitoring platform. This integration allows you send sensors from within Home Assistant (eg. energy meters, solar panels, batteries, ...) to your EnergyID-record, using their webhooks.
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: