mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-12-02 14:18:18 +00:00
Correct Quality Issues
- Fix: Decrease log message severity in `feature.py`. - Fix: Rename `_set_range_cli` to `_set_range_from_str`. - Add: Basic tests for string to Motion Range value converter function.
This commit is contained in:
@@ -124,7 +124,7 @@ class Motion(IotModule):
|
||||
name="Motion Sensor Range",
|
||||
icon="mdi:motion-sensor",
|
||||
attribute_getter="range",
|
||||
attribute_setter="_set_range_cli",
|
||||
attribute_setter="_set_range_from_str",
|
||||
type=Feature.Type.Choice,
|
||||
choices_getter="ranges",
|
||||
category=Feature.Category.Config,
|
||||
@@ -336,7 +336,7 @@ class Motion(IotModule):
|
||||
)
|
||||
return Range[value]
|
||||
|
||||
async def _set_range_cli(self, input: str) -> dict:
|
||||
async def _set_range_from_str(self, input: str) -> dict:
|
||||
value = self._parse_range_value(input)
|
||||
return await self.set_range(range=value)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user