Migrate integrations t-v to extend SensorEntity (#48216)

This commit is contained in:
Erik Montnemery 2021-03-22 19:47:44 +01:00 committed by GitHub
parent c900e3030b
commit 783b453bbe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 112 additions and 120 deletions

View file

@ -4,11 +4,10 @@ import re
import voluptuous as vol
from homeassistant.components.http import HomeAssistantView
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import CONF_EMAIL, CONF_NAME, DEGREE
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
API_PATH = "/api/torque"
@ -106,7 +105,7 @@ class TorqueReceiveDataView(HomeAssistantView):
return "OK!"
class TorqueSensor(Entity):
class TorqueSensor(SensorEntity):
"""Representation of a Torque sensor."""
def __init__(self, name, unit):