Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions homeassistant/components/spider/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
SUPPORT_TARGET_TEMPERATURE,
)
from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS
from homeassistant.helpers.entity import DeviceInfo

from .const import DOMAIN

Expand Down Expand Up @@ -46,14 +47,14 @@ def __init__(self, api, thermostat):
self.support_hvac.append(SPIDER_STATE_TO_HA[operation_value])

@property
def device_info(self):
def device_info(self) -> DeviceInfo:
"""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,
}
return DeviceInfo(
identifiers={(DOMAIN, self.thermostat.id)},
manufacturer=self.thermostat.manufacturer,
model=self.thermostat.model,
name=self.thermostat.name,
)

@property
def supported_features(self):
Expand Down
24 changes: 12 additions & 12 deletions homeassistant/components/spider/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ def __init__(self, api, power_plug) -> None:
@property
def device_info(self) -> DeviceInfo:
"""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,
}
return DeviceInfo(
identifiers={(DOMAIN, self.power_plug.id)},
manufacturer=self.power_plug.manufacturer,
model=self.power_plug.model,
name=self.power_plug.name,
)

@property
def unique_id(self) -> str:
Expand Down Expand Up @@ -84,12 +84,12 @@ def __init__(self, api, power_plug) -> None:
@property
def device_info(self) -> DeviceInfo:
"""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,
}
return DeviceInfo(
identifiers={(DOMAIN, self.power_plug.id)},
manufacturer=self.power_plug.manufacturer,
model=self.power_plug.model,
name=self.power_plug.name,
)

@property
def unique_id(self) -> str:
Expand Down
15 changes: 8 additions & 7 deletions homeassistant/components/spider/switch.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Support for Spider switches."""
from homeassistant.components.switch import SwitchEntity
from homeassistant.helpers.entity import DeviceInfo

from .const import DOMAIN

Expand All @@ -24,14 +25,14 @@ def __init__(self, api, power_plug):
self.power_plug = power_plug

@property
def device_info(self):
def device_info(self) -> DeviceInfo:
"""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,
}
return DeviceInfo(
identifiers={(DOMAIN, self.power_plug.id)},
manufacturer=self.power_plug.manufacturer,
model=self.power_plug.model,
name=self.power_plug.name,
)

@property
def unique_id(self):
Expand Down