mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-12-21 20:20:11 +00:00
Add support for tapo bulbs (#558)
* Add support for tapo light bulbs * Use TapoDevice for on/off * Add tapobulbs to discovery * Add partial support for effects Activating the effect does not work as I thought it would, but this implements rest of the interface from SmartLightStrip. * Add missing __init__ for tapo package * Make mypy happy * Add docstrings to make ruff happy * Implement state_information and has_emeter * Import tapoplug from kasa.tapo package * Add tapo L530 fixture * Enable tests for L530 fixture * Make ruff happy * Update fixture filename * Raise exceptions on invalid parameters * Return results in a wrapped dict * Implement set_* * Reorganize bulbs to iot&smart, fix tests for smarts * Fix linting * Fix BULBS_LIGHT_STRIP back to LIGHT_STRIPS
This commit is contained in:
@@ -313,10 +313,13 @@ class FakeSmartTransport(BaseTransport):
|
||||
async def send(self, request: str):
|
||||
request_dict = json_loads(request)
|
||||
method = request_dict["method"]
|
||||
params = request_dict["params"]
|
||||
if method == "component_nego" or method[:4] == "get_":
|
||||
return self.info[method]
|
||||
return {"result": self.info[method]}
|
||||
elif method[:4] == "set_":
|
||||
_LOGGER.debug("Call %s not implemented, doing nothing", method)
|
||||
target_method = f"get_{method[4:]}"
|
||||
self.info[target_method].update(params)
|
||||
return {"result": ""}
|
||||
|
||||
async def close(self) -> None:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user