Skip to content

Commit

Permalink
Merge remote-tracking branch 'blueprint/master' into dev
Browse files Browse the repository at this point in the history
# Conflicts:
#	custom_components/integration_blueprint/sensor.py
  • Loading branch information
Limych committed Feb 10, 2022
2 parents 1b4616b + b698c06 commit a802422
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion custom_components/integration_blueprint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
hass.config_entries.async_forward_entry_setup(entry, platform)
)

entry.add_update_listener(async_reload_entry)
entry.async_on_unload(entry.add_update_listener(async_reload_entry))
return True


Expand Down
7 changes: 4 additions & 3 deletions custom_components/integration_blueprint/sensor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Sensor platform for integration_blueprint."""
from homeassistant.components.sensor import SensorEntity
from homeassistant.core import HomeAssistant

from .const import DEFAULT_NAME, DOMAIN, ICON, SENSOR
Expand All @@ -11,7 +12,7 @@ async def async_setup_entry(hass: HomeAssistant, entry, async_add_entities):
async_add_entities([IntegrationBlueprintSensor(coordinator, entry)])


class IntegrationBlueprintSensor(IntegrationBlueprintEntity):
class IntegrationBlueprintSensor(IntegrationBlueprintEntity, SensorEntity):
"""integration_blueprint Sensor class."""

@property
Expand All @@ -20,8 +21,8 @@ def name(self):
return f"{DEFAULT_NAME}_{SENSOR}"

@property
def state(self):
"""Return the state of the sensor."""
def native_value(self):
"""Return the native value of the sensor."""
return self.coordinator.data.get("body")

@property
Expand Down

0 comments on commit a802422

Please sign in to comment.