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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ The following devices have been tested and confirmed as working. If your device
- **Wall Switches**: ES20M, HS200, HS210, HS220, KP405, KS200M, KS205<sup>\*</sup>, KS220M, KS225<sup>\*</sup>, KS230
- **Bulbs**: KL110, KL120, KL125, KL130, KL135, KL50, KL60, LB110
- **Light Strips**: KL400L5, KL420L5, KL430
- **Hubs**: KH100<sup>\*</sup>

### Supported Tapo<sup>\*</sup> devices

Expand Down
5 changes: 5 additions & 0 deletions SUPPORTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ Some newer Kasa devices require authentication. These are marked with <sup>*</su
- Hardware: 2.0 (US) / Firmware: 1.0.8
- Hardware: 2.0 (US) / Firmware: 1.0.9

### Hubs

- **KH100**
- Hardware: 1.0 (UK) / Firmware: 1.5.6<sup>\*</sup>


## Tapo devices

Expand Down
1 change: 1 addition & 0 deletions kasa/device_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def get_device_class_from_family(device_type: str) -> type[Device] | None:
"SMART.TAPOSWITCH": SmartBulb,
"SMART.KASAPLUG": SmartDevice,
"SMART.TAPOHUB": SmartDevice,
"SMART.KASAHUB": SmartDevice,
"SMART.KASASWITCH": SmartBulb,
"IOT.SMARTPLUGSWITCH": IotPlug,
"IOT.SMARTBULB": IotBulb,
Expand Down
1 change: 1 addition & 0 deletions kasa/deviceconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class DeviceFamilyType(Enum):
SmartTapoBulb = "SMART.TAPOBULB"
SmartTapoSwitch = "SMART.TAPOSWITCH"
SmartTapoHub = "SMART.TAPOHUB"
SmartKasaHub = "SMART.KASAHUB"


def _dataclass_from_dict(klass, in_val):
Expand Down
21 changes: 11 additions & 10 deletions kasa/smart/modules/temperature.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,17 @@ def __init__(self, device: SmartDevice, module: str):
icon="mdi:thermometer",
)
)
self._add_feature(
Feature(
device,
"Temperature warning",
container=self,
attribute_getter="temperature_warning",
type=FeatureType.BinarySensor,
icon="mdi:alert",
if "current_temp_exception" in device.sys_info:
self._add_feature(
Feature(
device,
"Temperature warning",
container=self,
attribute_getter="temperature_warning",
type=FeatureType.BinarySensor,
icon="mdi:alert",
)
)
)
self._add_feature(
Feature(
device,
Expand All @@ -57,7 +58,7 @@ def temperature(self):
@property
def temperature_warning(self) -> bool:
"""Return True if temperature is outside of the wanted range."""
return self._device.sys_info["current_temp_exception"] != 0
return self._device.sys_info.get("current_temp_exception", 0) != 0

@property
def temperature_unit(self):
Expand Down
8 changes: 4 additions & 4 deletions kasa/smart/modules/temperaturecontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class TemperatureControl(SmartModule):
"""Implementation of temperature module."""

REQUIRED_COMPONENT = "temperature_control"
REQUIRED_COMPONENT = "temp_control"

def __init__(self, device: SmartDevice, module: str):
super().__init__(device, module)
Expand Down Expand Up @@ -57,11 +57,11 @@ def maximum_target_temperature(self) -> int:
return self._device.sys_info["max_control_temp"]

@property
def target_temperature(self) -> int:
def target_temperature(self) -> float:
"""Return target temperature."""
return self._device.sys_info["target_temperature"]
return self._device.sys_info["target_temp"]

async def set_target_temperature(self, target: int):
async def set_target_temperature(self, target: float):
"""Set target temperature."""
if (
target < self.minimum_target_temperature
Expand Down
17 changes: 14 additions & 3 deletions kasa/tests/device_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@
*DIMMERS_SMART,
}

HUBS_SMART = {"H100"}
SENSORS_SMART = {"T315"}
HUBS_SMART = {"H100", "KH100"}
SENSORS_SMART = {"T310", "T315"}
THERMOSTATS_SMART = {"KE100"}

WITH_EMETER_IOT = {"HS110", "HS300", "KP115", "KP125", *BULBS_IOT}
WITH_EMETER_SMART = {"P110", "KP125M", "EP25"}
Expand All @@ -126,6 +127,7 @@
.union(HUBS_SMART)
.union(SENSORS_SMART)
.union(SWITCHES_SMART)
.union(THERMOSTATS_SMART)
)
ALL_DEVICES = ALL_DEVICES_IOT.union(ALL_DEVICES_SMART)

Expand Down Expand Up @@ -275,6 +277,9 @@ def parametrize(
sensors_smart = parametrize(
"sensors smart", model_filter=SENSORS_SMART, protocol_filter={"SMART.CHILD"}
)
thermostats_smart = parametrize(
"thermostats smart", model_filter=THERMOSTATS_SMART, protocol_filter={"SMART.CHILD"}
)
device_smart = parametrize(
"devices smart", model_filter=ALL_DEVICES_SMART, protocol_filter={"SMART"}
)
Expand All @@ -296,6 +301,7 @@ def check_categories():
+ dimmers_smart.args[1]
+ hubs_smart.args[1]
+ sensors_smart.args[1]
+ thermostats_smart.args[1]
)
diffs: set[FixtureInfo] = set(FIXTURE_DATA) - set(categorized_fixtures)
if diffs:
Expand All @@ -313,7 +319,12 @@ def check_categories():
def device_for_fixture_name(model, protocol):
if "SMART" in protocol:
for d in chain(
PLUGS_SMART, SWITCHES_SMART, STRIPS_SMART, HUBS_SMART, SENSORS_SMART
PLUGS_SMART,
SWITCHES_SMART,
STRIPS_SMART,
HUBS_SMART,
SENSORS_SMART,
THERMOSTATS_SMART,
):
if d in model:
return SmartDevice
Expand Down
Loading