Skip to content

Commit

Permalink
Update sensor.py
Browse files Browse the repository at this point in the history
Revert all changes and sync again with master.
  • Loading branch information
tslpre authored Aug 11, 2021
1 parent 595dd0c commit ce84906
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions custom_components/repsolluzygas/sensor.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
"""Platform for sensor integration."""
from .repsol_api import RepsolLuzYGasSensor
from homeassistant.helpers.entity import Entity
from homeassistant.components.sensor import (
PLATFORM_SCHEMA,
STATE_CLASS_MEASUREMENT,
SensorEntity,
)
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME, DEVICE_CLASS_ENERGY, ENERGY_KILO_WATT_HOUR
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
import voluptuous as vol
from homeassistant.util import dt as dt_util
import homeassistant.helpers.config_validation as cv
from datetime import timedelta
import requests
Expand Down Expand Up @@ -49,10 +44,8 @@ def __init__(self, client, name, variable, unit, is_master):
self._name = name
self.variable = variable
self.is_master = is_master
if self.unit = ENERGY_KILO_WATT_HOUR:
self._attr_state_class == STATE_CLASS_MEASUREMENT
self._attr_device_class = DEVICE_CLASS_ENERGY
self._attr_last_reset = dt_util.utc_from_timestamp(0)
self.unit = unit


@property
def name(self):
Expand Down

0 comments on commit ce84906

Please sign in to comment.