mirror of
https://github.com/home-assistant/core.git
synced 2025-11-14 05:20:17 +00:00
Fix comments for pull request
* Fix cleaner user config. * Remove bad disabling of linting. * Extract default mysensors version into constant. * Clean up selection of mysensors.CONST from version. * Update mysensors update decorator to add devices and update values in one go. * Fix persistence update. * Clean up setup of ports. * Setup of mysensors platforms from main mysensors component. * Clean up v_types selection in mysensors sensor platform. * Fix s_types and v_types selection version dependency in platforms.
This commit is contained in:
@@ -17,7 +17,7 @@ from homeassistant.const import (
|
||||
import homeassistant.components.mysensors as mysensors
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
DEPENDENCIES = ['mysensors']
|
||||
DEPENDENCIES = []
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
@@ -30,18 +30,21 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
mysensors.CONST.Presentation.S_LIGHT,
|
||||
mysensors.CONST.Presentation.S_BINARY,
|
||||
mysensors.CONST.Presentation.S_LOCK,
|
||||
mysensors.CONST.Presentation.S_SPRINKLER,
|
||||
mysensors.CONST.Presentation.S_WATER_LEAK,
|
||||
mysensors.CONST.Presentation.S_SOUND,
|
||||
mysensors.CONST.Presentation.S_VIBRATION,
|
||||
mysensors.CONST.Presentation.S_MOISTURE,
|
||||
]
|
||||
v_types = [
|
||||
mysensors.CONST.SetReq.V_ARMED,
|
||||
mysensors.CONST.SetReq.V_STATUS,
|
||||
mysensors.CONST.SetReq.V_LIGHT,
|
||||
mysensors.CONST.SetReq.V_LOCK_STATUS,
|
||||
]
|
||||
if float(mysensors.VERSION) >= 1.5:
|
||||
s_types.extend([
|
||||
mysensors.CONST.Presentation.S_SPRINKLER,
|
||||
mysensors.CONST.Presentation.S_WATER_LEAK,
|
||||
mysensors.CONST.Presentation.S_SOUND,
|
||||
mysensors.CONST.Presentation.S_VIBRATION,
|
||||
mysensors.CONST.Presentation.S_MOISTURE,
|
||||
])
|
||||
v_types.extend([mysensors.CONST.SetReq.V_STATUS, ])
|
||||
|
||||
@mysensors.mysensors_update
|
||||
def _sensor_update(gateway, port, devices, nid):
|
||||
|
||||
Reference in New Issue
Block a user