lmatula / ha_chint_pm

homeassistant Chint power meter integration
Creative Commons Zero v1.0 Universal
13 stars 7 forks source link

Serial interface initialization error #1

Closed orlikom closed 1 year ago

orlikom commented 1 year ago

While trying to run the integration with serial interface I found error in line 317 of init.py. The entry.data[CONF_HOST] is not defined for serial inteface and the integration fails to run. I suggest change in lines 317-322 to: if entry.data[CONF_HOST] is None: port_host = "" port_name = str(entry.data[CONF_PORT]) else: port_host = "".join(filter(str.isalnum, entry.data[CONF_HOST])) port_name = "".join(filter(str.isalnum, entry.data[CONF_PORT]))

lmatula commented 1 year ago

I made changes, plese test latest master commit. I'm can't test direct serial connetion