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
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ The following devices have been tested and confirmed as working. If your device
- **Bulbs**: KL110, KL120, KL125, KL130, KL135, KL50, KL60, LB110
- **Light Strips**: KL400L5, KL420L5, KL430
- **Hubs**: KH100<sup>\*</sup>
- **Hub-Connected Devices<sup>\*\*\*</sup>**: KE100<sup>\*</sup>

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

Expand All @@ -241,10 +242,12 @@ The following devices have been tested and confirmed as working. If your device
- **Bulbs**: L510B, L510E, L530E
- **Light Strips**: L900-10, L900-5, L920-5, L930-5
- **Hubs**: H100
- **Hub-Connected Devices<sup>\*\*\*</sup>**: T300, T310, T315

<!--SUPPORTED_END-->
<sup>*</sup>&nbsp; Model requires authentication<br>
<sup>**</sup> Newer versions require authentication
<sup>\*</sup>&nbsp;&nbsp; Model requires authentication<br>
<sup>\*\*</sup>&nbsp; Newer versions require authentication<br>
<sup>\*\*\*</sup> Devices may work across TAPO/KASA branded hubs

See [supported devices in our documentation](SUPPORTED.md) for more detailed information about tested hardware and software versions.

Expand Down
19 changes: 17 additions & 2 deletions SUPPORTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The following devices have been tested and confirmed as working. If your device
<!--SUPPORTED_START-->
## Kasa devices

Some newer Kasa devices require authentication. These are marked with <sup>*</sup> in the list below.
Some newer Kasa devices require authentication. These are marked with <sup>*</sup> in the list below.<br>Hub-Connected Devices may work across TAPO/KASA branded hubs even if they don't work across the native apps.

### Plugs

Expand Down Expand Up @@ -134,10 +134,16 @@ Some newer Kasa devices require authentication. These are marked with <sup>*</su
- **KH100**
- Hardware: 1.0 (UK) / Firmware: 1.5.6<sup>\*</sup>

### Hub-Connected Devices

- **KE100**
- Hardware: 1.0 (EU) / Firmware: 2.8.0<sup>\*</sup>
- Hardware: 1.0 (UK) / Firmware: 2.8.0<sup>\*</sup>


## Tapo devices

All Tapo devices require authentication.
All Tapo devices require authentication.<br>Hub-Connected Devices may work across TAPO/KASA branded hubs even if they don't work across the native apps.

### Plugs

Expand Down Expand Up @@ -204,5 +210,14 @@ All Tapo devices require authentication.
- Hardware: 1.0 (EU) / Firmware: 1.2.3
- Hardware: 1.0 (EU) / Firmware: 1.5.5

### Hub-Connected Devices

- **T300**
- Hardware: 1.0 (EU) / Firmware: 1.7.0
- **T310**
- Hardware: 1.0 (EU) / Firmware: 1.5.0
- **T315**
- Hardware: 1.0 (EU) / Firmware: 1.7.0


<!--SUPPORTED_END-->
35 changes: 27 additions & 8 deletions devtools/generate_supported.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ class SupportedVersion(NamedTuple):
DeviceType.StripSocket: "Power Strips",
DeviceType.Dimmer: "Wall Switches",
DeviceType.WallSwitch: "Wall Switches",
DeviceType.Fan: "Wall Switches",
DeviceType.Bulb: "Bulbs",
DeviceType.LightStrip: "Light Strips",
DeviceType.Hub: "Hubs",
DeviceType.Sensor: "Sensors",
DeviceType.Sensor: "Hub-Connected Devices",
DeviceType.Thermostat: "Hub-Connected Devices",
}


Expand Down Expand Up @@ -106,7 +108,7 @@ def _supported_summary(supported):
return _supported_text(
supported,
"### Supported $brand$auth devices\n\n$types\n",
"- **$type_**: $models\n",
"- **$type_$type_asterix**: $models\n",
)


Expand Down Expand Up @@ -136,6 +138,10 @@ def _supported_text(
if brand == "kasa"
else "All Tapo devices require authentication."
)
preamble_text += (
"<br>Hub-Connected Devices may work across TAPO/KASA branded "
+ "hubs even if they don't work across the native apps."
)
brand_text = brand.capitalize()
brand_auth = r"<sup>\*</sup>" if brand == "tapo" else ""
types_text = ""
Expand Down Expand Up @@ -177,24 +183,37 @@ def _supported_text(
else:
models_list.append(f"{model}{auth_flag}")
models_text = models_text if models_text else ", ".join(models_list)
types_text += typest.substitute(type_=supported_type, models=models_text)
type_asterix = (
r"<sup>\*\*\*</sup>"
if supported_type == "Hub-Connected Devices"
else ""
)
types_text += typest.substitute(
type_=supported_type, type_asterix=type_asterix, models=models_text
)
brands += brandt.substitute(
brand=brand_text, types=types_text, auth=brand_auth, preamble=preamble_text
)
return brands


def _get_smart_supported(supported):
for file in Path(SMART_FOLDER).glob("*.json"):
for file in Path(SMART_FOLDER).glob("**/*.json"):
with file.open() as f:
fixture_data = json.load(f)

model, _, region = fixture_data["discovery_result"]["device_model"].partition(
"("
)
if "discovery_result" in fixture_data:
model, _, region = fixture_data["discovery_result"][
"device_model"
].partition("(")
device_type = fixture_data["discovery_result"]["device_type"]
else: # child devices of hubs do not have discovery result
model = fixture_data["get_device_info"]["model"]
region = fixture_data["get_device_info"].get("specs")
device_type = fixture_data["get_device_info"]["type"]
# P100 doesn't have region HW
region = region.replace(")", "") if region else ""
device_type = fixture_data["discovery_result"]["device_type"]

_protocol, devicetype = device_type.split(".")
brand = devicetype[:4].lower()
components = [
Expand Down
4 changes: 4 additions & 0 deletions kasa/smart/smartdevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,10 @@ def _get_device_type_from_components(
return DeviceType.Bulb
if "SWITCH" in device_type:
return DeviceType.WallSwitch
if "SENSOR" in device_type:
return DeviceType.Sensor
if "ENERGY" in device_type:
return DeviceType.Thermostat
_LOGGER.warning("Unknown device type, falling back to plug")
return DeviceType.Plug

Expand Down