gtdiehl / iotawatt_ha

IoTaWatt for Home Assistant
Apache License 2.0
16 stars 16 forks source link

Unable to prepare setup for platform iotawatt.sensor: Platform not found (cannot import name 'VOLT' from 'homeassistant.const' #8

Closed djhampson closed 3 years ago

djhampson commented 3 years ago
Logger: homeassistant.setup
Source: setup.py:311
First occurred: August 3, 2021, 10:43:34 AM (2 occurrences)
Last logged: 12:19:05 PM

Unable to prepare setup for platform iotawatt.sensor: Platform not found (cannot import name 'VOLT' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)).

I'm getting the following error when loading the iotawatt integration. This has started occurring since the core-2021.8 update.

gtdiehl commented 3 years ago

Yeah it appears HA 2021.8 renamed the VOLT constant to ELECTRIC_POTENTIAL_VOLT

The issue is how to make the IoTaWatt integration work with <2021.8 and >=2021.8 versions? Maybe use my own constants?

Screen Shot 2021-08-03 at 7 48 40 PM

Screen Shot 2021-08-03 at 7 48 16 PM

gtdiehl commented 3 years ago

@djhampson Can you update the Integration through HACS? Two changes have been made, so it should work with HA 2021.8 and previous HA versions now.

djhampson commented 3 years ago

Thanks you @gtdiehl - working again. appreciate it!