-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
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
Support disconnected Powerwall configuration #67325
Support disconnected Powerwall configuration #67325
Conversation
Hi @jumbledbytes, It seems you haven't yet signed a CLA. Please do so here. Once you do that we will be able to review and accept this pull request. Thanks! |
Hey there @bdraco, @jrester, mind taking a look at this pull request as it has been labeled with an integration ( |
Hi @bdraco @jrester this is my first contribution to this project to add a fix I applied locally to get the Tesla integration to work properly for me (my Powerwall is backordered, but the Tesla Backup Gateway is installed and functioning properly). This change allows me to monitor the PV system inputs into the Gateway while I wait for the Powerwall. Please let me know if there is anything I should do from a testing or convention perspective that is missing from this small change. |
@jumbledbytes @bdraco Might the |
battery = self.data.meters.get_meter(MeterType.BATTERY) | ||
if battery == None: | ||
return False |
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.
battery = self.data.meters.get_meter(MeterType.BATTERY) | |
if battery == None: | |
return False | |
if (battery := self.data.meters.get_meter(MeterType.BATTERY)) is None: | |
return False |
I agree. Setting available to False makes more sense in this case. |
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 see comments above. Thanks 👍
…hub.com:jumbledbytes/core into jumbledbytes/fix/support_disconnected_powerwall
Co-authored-by: J. Nick Koston <[email protected]>
Proposed change
This is a small change that fixes the
is_on
function in the binary sensor for the powerwall component to handle the case when the Powerwall is disconnected or unavailable. Currently if the powerwall is disconnected from a PV system with a Tesla Gateway configured the Tesla integration will fail to load data due to:This error occurs because when the Powerwall is not available
self.data.meters.get_meter(MeterType.BATTERY)
returnsNone
. This prevents the sensors for a functional Tesla Gateway from reporting data to Home Assistant.Type of change
This is a small bug fix that makes the powerwall integration work in configurations where only the gateway is online and available.
Additional information
Checklist
I have tested this change locally and it fixes the issue for me. I'm not sure how or where to add tests for this edge case, but can add them with a pointer on where the appropriate tests are for this.
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
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests:
This is my first contribution to this project.