Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update name (fixes #17752) #17756

Merged
merged 1 commit into from Oct 24, 2018
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions homeassistant/components/binary_sensor/zha.py
Expand Up @@ -13,7 +13,7 @@

DEPENDENCIES = ['zha']

# ZigBee Cluster Library Zone Type to Home Assistant device class
# Zigbee Cluster Library Zone Type to Home Assistant device class
CLASS_MAPPING = {
0x000d: 'motion',
0x0015: 'opening',
Expand Down Expand Up @@ -145,7 +145,7 @@ class Remote(zha.Entity, BinarySensorDevice):
_domain = DOMAIN

class OnOffListener:
"""Listener for the OnOff ZigBee cluster."""
"""Listener for the OnOff Zigbee cluster."""

def __init__(self, entity):
"""Initialize OnOffListener."""
Expand All @@ -170,7 +170,7 @@ def zdo_command(self, *args, **kwargs):
pass

class LevelListener:
"""Listener for the LevelControl ZigBee cluster."""
"""Listener for the LevelControl Zigbee cluster."""

def __init__(self, entity):
"""Initialize LevelListener."""
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/binary_sensor/zigbee.py
@@ -1,5 +1,5 @@
"""
Contains functionality to use a ZigBee device as a binary sensor.
Contains functionality to use a Zigbee device as a binary sensor.

For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.zigbee/
Expand All @@ -23,7 +23,7 @@


def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the ZigBee binary sensor platform."""
"""Set up the Zigbee binary sensor platform."""
add_entities(
[ZigBeeBinarySensor(hass, ZigBeeDigitalInConfig(config))], True)

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/switch/xiaomi_aqara.py
Expand Up @@ -106,7 +106,7 @@ def device_state_attributes(self):

@property
def should_poll(self):
"""Return the polling state. Polling needed for zigbee plug only."""
"""Return the polling state. Polling needed for Zigbee plug only."""
return self._supports_power_consumption

def turn_on(self, **kwargs):
Expand Down
6 changes: 3 additions & 3 deletions homeassistant/components/switch/zigbee.py
@@ -1,5 +1,5 @@
"""
Contains functionality to use a ZigBee device as a switch.
Contains functionality to use a Zigbee device as a switch.

For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.zigbee/
Expand All @@ -25,11 +25,11 @@


def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the ZigBee switch platform."""
"""Set up the Zigbee switch platform."""
add_entities([ZigBeeSwitch(hass, ZigBeeDigitalOutConfig(config))])


class ZigBeeSwitch(ZigBeeDigitalOut, SwitchDevice):
"""Representation of a ZigBee Digital Out device."""
"""Representation of a Zigbee Digital Out device."""

pass
28 changes: 14 additions & 14 deletions homeassistant/components/zigbee.py
@@ -1,5 +1,5 @@
"""
Support for ZigBee devices.
Support for Zigbee devices.

For more details about this component, please refer to the documentation at
https://home-assistant.io/components/zigbee/
Expand Down Expand Up @@ -60,7 +60,7 @@


def setup(hass, config):
"""Set up the connection to the ZigBee device."""
"""Set up the connection to the Zigbee device."""
global DEVICE
global GPIO_DIGITAL_OUTPUT_LOW
global GPIO_DIGITAL_OUTPUT_HIGH
Expand Down Expand Up @@ -91,13 +91,13 @@ def setup(hass, config):
try:
ser = Serial(usb_device, baud)
except SerialException as exc:
_LOGGER.exception("Unable to open serial port for ZigBee: %s", exc)
_LOGGER.exception("Unable to open serial port for Zigbee: %s", exc)
return False
DEVICE = ZigBee(ser)
hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, close_serial_port)

def _frame_received(frame):
"""Run when a ZigBee frame is received.
"""Run when a Zigbee frame is received.

Pickles the frame, then encodes it into base64 since it contains
non JSON serializable binary.
Expand All @@ -110,7 +110,7 @@ def _frame_received(frame):


def close_serial_port(*args):
"""Close the serial port we're using to communicate with the ZigBee."""
"""Close the serial port we're using to communicate with the Zigbee."""
DEVICE.zb.serial.close()


Expand Down Expand Up @@ -141,7 +141,7 @@ def address(self):
"""Return the address of the device.

If an address has been provided, unhexlify it, otherwise return None
as we're talking to our local ZigBee device.
as we're talking to our local Zigbee device.
"""
address = self._config.get("address")
if address is not None:
Expand All @@ -167,7 +167,7 @@ class ZigBeeDigitalInConfig(ZigBeePinConfig):
"""A subclass of ZigBeePinConfig."""

def __init__(self, config):
"""Initialise the ZigBee Digital input config."""
"""Initialise the Zigbee Digital input config."""
super(ZigBeeDigitalInConfig, self).__init__(config)
self._bool2state, self._state2bool = self.boolean_maps

Expand All @@ -194,15 +194,15 @@ def boolean_maps(self):

@property
def bool2state(self):
"""Return a dictionary mapping the internal value to the ZigBee value.
"""Return a dictionary mapping the internal value to the Zigbee value.

For the translation of on/off as being pin high or low.
"""
return self._bool2state

@property
def state2bool(self):
"""Return a dictionary mapping the ZigBee value to the internal value.
"""Return a dictionary mapping the Zigbee value to the internal value.

For the translation of pin high/low as being on or off.
"""
Expand All @@ -217,7 +217,7 @@ class ZigBeeDigitalOutConfig(ZigBeePinConfig):
"""

def __init__(self, config):
"""Initialize the ZigBee Digital out."""
"""Initialize the Zigbee Digital out."""
super(ZigBeeDigitalOutConfig, self).__init__(config)
self._bool2state, self._state2bool = self.boolean_maps
self._should_poll = config.get("poll", False)
Expand Down Expand Up @@ -260,7 +260,7 @@ def state2bool(self):


class ZigBeeAnalogInConfig(ZigBeePinConfig):
"""Representation of a ZigBee GPIO pin set to analog in."""
"""Representation of a Zigbee GPIO pin set to analog in."""

@property
def max_voltage(self):
Expand Down Expand Up @@ -321,7 +321,7 @@ def is_on(self):
return self._state

def update(self):
"""Ask the ZigBee device what state its input pin is in."""
"""Ask the Zigbee device what state its input pin is in."""
try:
sample = DEVICE.get_sample(self._config.address)
except ZIGBEE_TX_FAILURE:
Expand All @@ -331,12 +331,12 @@ def update(self):
return
except ZIGBEE_EXCEPTION as exc:
_LOGGER.exception(
"Unable to get sample from ZigBee device: %s", exc)
"Unable to get sample from Zigbee device: %s", exc)
return
pin_name = DIGITAL_PINS[self._config.pin]
if pin_name not in sample:
_LOGGER.warning(
"Pin %s (%s) was not in the sample provided by ZigBee device "
"Pin %s (%s) was not in the sample provided by Zigbee device "
"%s.",
self._config.pin, pin_name, hexlify(self._config.address))
return
Expand Down