Skip to content

Commit

Permalink
Merge branch 'ads' of https://github.com/MrLeeh/home-assistant into ads
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Lehmann committed Nov 16, 2017
2 parents f6024a3 + 4631da4 commit 6de2c6b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions homeassistant/components/light/ads.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def turn_on(self, **kwargs):
if brightness is not None:
self._brightness = brightness

bval = math.floor(self._brightness / 256.0 * 100.0)
bval = math.floor(self._brightness)

self._ads_hub.write_by_name(self.varname_enable, True,
self._ads_hub.PLCTYPE_BOOL)
Expand All @@ -98,7 +98,7 @@ def turn_off(self, **kwargs):
brightness = kwargs.get(ATTR_BRIGHTNESS)
if brightness is not None:
self._brightness = brightness
bval = math.floor(self._brightness / 256.0 * 100.0)
bval = math.floor(self._brightness)
self._ads_hub.write_by_name(self.varname_enable, False,
self._ads_hub.PLCTYPE_BOOL)
if self.varname_brightness is not None:
Expand All @@ -108,7 +108,7 @@ def turn_off(self, **kwargs):

def value_changed(self, val):
"""Handle value change."""
self._brightness = math.floor(val / 100.0 * 256.0)
self._brightness = val
self._on_state = bool(val != 0)
self.schedule_update_ha_state()

Expand Down

0 comments on commit 6de2c6b

Please sign in to comment.