Expose spider device information (#44085)

* Expose spider device information

* Set correct identifiers
This commit is contained in:
Peter Nijssen 2020-12-11 21:49:14 +01:00 committed by GitHub
parent e67809713f
commit bcebc588a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 25 additions and 5 deletions

View file

@ -44,6 +44,16 @@ class SpiderThermostat(ClimateEntity):
self.api = api
self.thermostat = thermostat
@property
def device_info(self):
"""Return the device_info of the device."""
return {
"identifiers": {(DOMAIN, self.thermostat.id)},
"name": self.thermostat.name,
"manufacturer": self.thermostat.manufacturer,
"model": self.thermostat.model,
}
@property
def supported_features(self):
"""Return the list of supported features."""

View file

@ -3,7 +3,7 @@
"name": "Itho Daalderop Spider",
"documentation": "https://www.home-assistant.io/integrations/spider",
"requirements": [
"spiderpy==1.3.1"
"spiderpy==1.4.2"
],
"codeowners": [
"@peternijssen"

View file

@ -5,7 +5,7 @@ from .const import DOMAIN
async def async_setup_entry(hass, config, async_add_entities):
"""Initialize a Spider thermostat."""
"""Initialize a Spider Power Plug."""
api = hass.data[DOMAIN][config.entry_id]
async_add_entities(
[
@ -19,10 +19,20 @@ class SpiderPowerPlug(SwitchEntity):
"""Representation of a Spider Power Plug."""
def __init__(self, api, power_plug):
"""Initialize the Vera device."""
"""Initialize the Spider Power Plug."""
self.api = api
self.power_plug = power_plug
@property
def device_info(self):
"""Return the device_info of the device."""
return {
"identifiers": {(DOMAIN, self.power_plug.id)},
"name": self.power_plug.name,
"manufacturer": self.power_plug.manufacturer,
"model": self.power_plug.model,
}
@property
def unique_id(self):
"""Return the ID of this switch."""

View file

@ -2087,7 +2087,7 @@ speak2mary==1.4.0
speedtest-cli==2.1.2
# homeassistant.components.spider
spiderpy==1.3.1
spiderpy==1.4.2
# homeassistant.components.spotcrime
spotcrime==1.0.4

View file

@ -1024,7 +1024,7 @@ speak2mary==1.4.0
speedtest-cli==2.1.2
# homeassistant.components.spider
spiderpy==1.3.1
spiderpy==1.4.2
# homeassistant.components.spotify
spotipy==2.16.1