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

KeyError: 'percent' #189

Closed
zSprawl opened this issue May 20, 2023 · 1 comment · Fixed by #194
Closed

KeyError: 'percent' #189

zSprawl opened this issue May 20, 2023 · 1 comment · Fixed by #194
Assignees

Comments

@zSprawl
Copy link

zSprawl commented May 20, 2023

Describe the bug
Upon start or restart of the Bhyve integration, it throws an error. The integration loads, and I can control each of the 4 hoses/valves, but it does not display any of the sensors for battery, state, or four zones. These sensors remain Unavailable despite being able to control the device manually.

I have tried rebooting multiple times and have replaced the battery. The battery shows at 100% now in the BHyve app.

Expected behaviour
Each of the sensors populate with battery information, current state of the device, and the last time each zone was watered.

BHyve devices
I'm using an HT34-0001 with firmware 58 (the latest). It's a 4-hose watering device.

Device Diagnostics
Logger: homeassistant.components.sensor
Source: custom_components/bhyve/sensor.py:92
Integration: Sensor (documentation, issues)
First occurred: 9:31:39 AM (4 occurrences)
Last logged: 10:05:10 AM
Error while setting up bhyve platform for sensor

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/bhyve/sensor.py", line 58, in async_setup_entry
sensors.append(BHyveBatterySensor(hass, bhyve, device))
File "/config/custom_components/bhyve/sensor.py", line 73, in init
super().init(
File "/config/custom_components/bhyve/init.py", line 268, in init
self._setup(device)
File "/config/custom_components/bhyve/sensor.py", line 92, in _setup
self._state = battery["percent"]
KeyError: 'percent'

@disforw
Copy link
Contributor

disforw commented May 21, 2023

I fixed in PR #181, awaiting approval….

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 a pull request may close this issue.

3 participants