mirror of
https://github.com/python-kasa/python-kasa.git
synced 2026-11-22 05:53:33 +00:00
Apply the KLAP response budget to IoT bulbs (#1852)
This centralizes the response budgets in `IotDevice.max_device_response_size` and removes the bulb override: - KLAP: 2048 for every IoT device. - Other transports: 4096 for bulbs and light strips, 16 KiB for other IoT devices.
This commit is contained in:
@@ -539,8 +539,3 @@ class IotBulb(IotDevice):
|
||||
return await self._query_helper(
|
||||
"smartlife.iot.common.system", "set_dev_alias", {"alias": alias}
|
||||
)
|
||||
|
||||
@property
|
||||
def max_device_response_size(self) -> int:
|
||||
"""Returns the maximum response size the device can safely construct."""
|
||||
return 4096
|
||||
|
||||
@@ -735,6 +735,8 @@ class IotDevice(Device):
|
||||
# and have even less room right after a state change.
|
||||
if self.config.connection_type.encryption_type is DeviceEncryptionType.Klap:
|
||||
return 2048
|
||||
if self.device_type in {DeviceType.Bulb, DeviceType.LightStrip}:
|
||||
return 4096
|
||||
return 16 * 1024
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user