Skip to content

Commit

Permalink
debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
turbokongen committed Apr 4, 2020
1 parent 421dc2d commit ef6aeca
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions custom_components/ams/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity import Entity
from homeassistant.core import callback
from homeassistant.const import DEVICE_CLASS_POWER
import custom_components.ams as amshub
from .const import (
_LOGGER,
Expand All @@ -26,6 +25,7 @@ def async_add_sensor():
hass.data[DOMAIN].data)
_LOGGER.debug('AMS_SENSORS in async_setup_entry-async_add_sensor= %s',
hass.data[amshub.AMS_SENSORS])
_LOGGER.debug('AMS_NEW_SENSORS= %s', sensors_to_add)

for sensor_name in list(sensors_to_add):
sensor_states = {
Expand All @@ -34,7 +34,7 @@ def async_add_sensor():
'attributes': data[sensor_name].get('attributes')
}
sensors.append(AmsSensor(hass, sensor_states))
_LOGGER.debug('async_add_sensor in async_setup_entry')
_LOGGER.debug('sensors in async_add_entities = %s', sensors)
async_add_entities(sensors)
async_dispatcher_connect(hass, SIGNAL_NEW_AMS_SENSOR, async_add_sensor)

Expand Down Expand Up @@ -112,11 +112,6 @@ def device_info(self) -> dict:
"model": self._attributes.get('meter_type'),
}

@property
def device_class(self):
"""Set the device_class of the sensor."""
return DEVICE_CLASS_POWER

async def async_added_to_hass(self):
"""Register callbacks."""
async_dispatcher_connect(
Expand Down

0 comments on commit ef6aeca

Please sign in to comment.