Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def update(self):
"""Get the latest data from the plugwise circles."""
import plugwise
self.current_consumption = plugwise.Circle(self.mac, self.stick).get_power_usage()
_LOGGER.debug("Current Consumption: %s", self.current_consumption)
self.getinfo = plugwise.Circle(self.mac, self.stick).get_info()
self.state = self.getinfo['relay_state']
self.fwversion = self.getinfo['fw_ver']
self.datetime = self.getinfo['datetime']
_LOGGER.debug("Relay State: %s", self.state)
return
def switch_off(self):
"""Turn the switch off."""
import plugwise
plugwise.Circle(self.mac, self.stick).switch_off()
def update(self):
"""Get the latest data from the plugwise circles."""
import plugwise
self.current_consumption = plugwise.Circle(self.mac, self.stick).get_power_usage()
_LOGGER.debug("Current Consumption: %s", self.current_consumption)
self.getinfo = plugwise.Circle(self.mac, self.stick).get_info()
self.state = self.getinfo['relay_state']
self.fwversion = self.getinfo['fw_ver']
self.datetime = self.getinfo['datetime']
_LOGGER.debug("Relay State: %s", self.state)
return
def switch_on(self):
"""Turn the switch on."""
import plugwise
plugwise.Circle(self.mac, self.stick).switch_on()