File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
custom_components/powersensor Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -133,12 +133,16 @@ async def handle_discovered_sensor(sensor_mac: str, sensor_role: str):
133133 ]
134134 async_add_entities (new_sensors , True )
135135 async_dispatcher_send (hass , SENSOR_ADDED_TO_HA_SIGNAL , sensor_mac , sensor_role )
136- mains_present = entry .data .get ('with_mains' , False )
137- if sensor_role == "solar" and mains_present :
136+ with_mains = entry .data .get ('with_mains' , False )
137+ with_solar = entry .data .get ('with_solar' , False )
138+
139+ if sensor_role == "solar" and with_mains :
138140 async_dispatcher_send (hass , HAVE_SOLAR_SENSOR_SIGNAL )
139141
140142 if sensor_role == "house-net" :
141143 async_dispatcher_send (hass , HAVE_MAINS_SENSOR_SIGNAL )
144+ if with_solar :
145+ async_dispatcher_send (hass , HAVE_SOLAR_SENSOR_SIGNAL )
142146
143147 entry .async_on_unload (
144148 async_dispatcher_connect (
You can’t perform that action at this time.
0 commit comments