Skip to content

Commit

Permalink
Rename of Strip to PowerStrip to avoid confusion with led strips. (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi authored and rytilahti committed Oct 21, 2017
1 parent ec71776 commit 61874e3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion miio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from miio.airpurifier import AirPurifier
from miio.airhumidifier import AirHumidifier
from miio.waterpurifier import WaterPurifier
from miio.strip import Strip
from miio.powerstrip import PowerStrip
from miio.ceil import Ceil
from miio.philips_bulb import PhilipsBulb
from miio.philips_eyecare import PhilipsEyecare
Expand Down
6 changes: 3 additions & 3 deletions miio/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import ipaddress
import inspect
import codecs
from . import (Device, Vacuum, Plug, PlugV1, Strip, AirPurifier, Ceil,
from . import (Device, Vacuum, Plug, PlugV1, PowerStrip, AirPurifier, Ceil,
PhilipsBulb, PhilipsEyecare, ChuangmiIr, AirHumidifier,
WaterPurifier, WifiSpeaker, Yeelight)
from typing import Union, Callable, Dict, Optional # noqa: F401
Expand All @@ -17,8 +17,8 @@
"chuangmi-plug-m1": Plug,
"chuangmi-plug-v2": Plug,
"chuangmi-plug-v1": PlugV1,
"qmi-powerstrip-v1": Strip,
"zimi-powerstrip-v2": Strip,
"qmi-powerstrip-v1": PowerStrip,
"zimi-powerstrip-v2": PowerStrip,
"zhimi-airpurifier-m1": AirPurifier,
"zhimi-airpurifier-m2": AirPurifier,
"zhimi-airpurifier-v1": AirPurifier,
Expand Down
14 changes: 7 additions & 7 deletions miio/strip.py → miio/powerstrip.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class PowerMode(enum.Enum):
Normal = 'normal'


class StripStatus:
"""Container for status reports from the strip."""
class PowerStripStatus:
"""Container for status reports from the power strip."""

def __init__(self, data: Dict[str, Any]) -> None:
# Device model: qmi.powerstrip.v1, zimi.powerstrip.v2
Expand Down Expand Up @@ -47,7 +47,7 @@ def mode(self) -> PowerMode:
return PowerMode(self.data["mode"])

def __str__(self) -> str:
s = "<StripStatus power=%s, temperature=%s, " \
s = "<PowerStripStatus power=%s, temperature=%s, " \
"load_power=%s mode=%s>" % \
(self.power,
self.temperature,
Expand All @@ -56,10 +56,10 @@ def __str__(self) -> str:
return s


class Strip(Device):
"""Main class representing the smart strip."""
class PowerStrip(Device):
"""Main class representing the smart power strip."""

def status(self) -> StripStatus:
def status(self) -> PowerStripStatus:
"""Retrieve properties."""
properties = ['power', 'temperature', 'current', 'mode']
values = self.send(
Expand All @@ -75,7 +75,7 @@ def status(self) -> StripStatus:
"count (%s) of received values.",
properties_count, values_count)

return StripStatus(
return PowerStripStatus(
defaultdict(lambda: None, zip(properties, values)))

def on(self):
Expand Down

0 comments on commit 61874e3

Please sign in to comment.