diff --git a/homeassistant/components/light/mysensors.py b/homeassistant/components/light/mysensors.py index f4fd7bc3c7980a9411a3bad497e04b9669a1e7e0..906f06e6ab438dd7e9cc34c448f56984457119c1 100644 --- a/homeassistant/components/light/mysensors.py +++ b/homeassistant/components/light/mysensors.py @@ -33,11 +33,9 @@ def setup_platform(hass, config, add_devices, discovery_info=None): pres = gateway.const.Presentation set_req = gateway.const.SetReq map_sv_types = { - pres.S_LIGHT: [set_req.V_LIGHT], pres.S_DIMMER: [set_req.V_DIMMER], } device_class_map = { - pres.S_LIGHT: MySensorsLightPlain, pres.S_DIMMER: MySensorsLightDimmer, } if float(gateway.version) >= 1.5: @@ -45,7 +43,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None): map_sv_types.update({ pres.S_RGB_LIGHT: [set_req.V_RGB], }) - map_sv_types[pres.S_LIGHT].append(set_req.V_STATUS) map_sv_types[pres.S_DIMMER].append(set_req.V_PERCENTAGE) device_class_map.update({ pres.S_RGB_LIGHT: MySensorsLightRGB, @@ -263,25 +260,6 @@ class MySensorsLight(Light): self._values[value_type] = value -class MySensorsLightPlain(MySensorsLight): - """Light child class to MySensorsLight.""" - - def turn_on(self, **kwargs): - """Turn the device on.""" - self._turn_on_light() - - def turn_off(self, **kwargs): - """Turn the device off.""" - ret = self._turn_off_light() - self._turn_off_main(value_type=ret[ - ATTR_VALUE_TYPE], value=ret[ATTR_VALUE]) - - def update(self): - """Update the controller with the latest value from a sensor.""" - self._update_main() - self._update_light() - - class MySensorsLightDimmer(MySensorsLight): """Dimmer child class to MySensorsLight.""" diff --git a/homeassistant/components/switch/mysensors.py b/homeassistant/components/switch/mysensors.py index 9921ddb3602af1542314ed65e3675c6ca9c312ce..d10ce2eabf2470f9f97c41dcd277c7b52ef447ad 100644 --- a/homeassistant/components/switch/mysensors.py +++ b/homeassistant/components/switch/mysensors.py @@ -32,6 +32,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): pres.S_DOOR: [set_req.V_ARMED], pres.S_MOTION: [set_req.V_ARMED], pres.S_SMOKE: [set_req.V_ARMED], + pres.S_LIGHT: [set_req.V_LIGHT], pres.S_LOCK: [set_req.V_LOCK_STATUS], } if float(gateway.version) >= 1.5: @@ -43,6 +44,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): pres.S_VIBRATION: [set_req.V_ARMED], pres.S_MOISTURE: [set_req.V_ARMED], }) + map_sv_types[pres.S_LIGHT].append(set_req.V_STATUS) devices = {} gateway.platform_callbacks.append(mysensors.pf_callback_factory(