Open dr-harper opened 2 years ago
I was running into an error with this plugin when the carbon intensity of the grid was "very high".
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 522, in _async_add_entity original_icon=entity.icon, File "/config/custom_components/carbon_intensity_uk/sensor.py", line 38, in icon intensity = INTENSITY[index] KeyError: 'very high'
I managed to get this working again by changing the const.py file to include versions of the values without the underscore:
const.py
INTENSITY = { "very_low" : 0, "very low" : 0, "low" : 1, "moderate": 2, "high": 3, "very_high": 4, "very high": 4, }
I haven't properly tested this but it seems to be working. It might be possible to delete the very_low and very_high values.
very_low
very_high
Thanks @dr-harper, I'll fix this issue in the next release.
I was running into an error with this plugin when the carbon intensity of the grid was "very high".
I managed to get this working again by changing the
const.py
file to include versions of the values without the underscore:I haven't properly tested this but it seems to be working. It might be possible to delete the
very_low
andvery_high
values.