How to use the plugwise.protocol.CompositeType.unserialize function in plugwise

To help you get started, we’ve selected a few plugwise examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SevenW / Plugwise-2-py / plugwise / protocol.py View on Github external
def unserialize(self, val):
        CompositeType.unserialize(self, val)
        minutes = self.minutes.value
        hours = minutes // 60
        days = hours // 24
        hours -= (days*24)
        minutes -= (days*24*60)+(hours*60)
        try:
            self.value = datetime.datetime(self.year.value, self.month.value, days+1, hours, minutes)
        except ValueError:
            debug('value error while attempting to construct datetime object')
            self.value = None
github SevenW / Plugwise-2-py / plugwise / protocol.py View on Github external
def unserialize(self, val):
        CompositeType.unserialize(self, val)
        self.value = datetime.time(self.hour.value, self.minute.value, self.second.value)
github SevenW / Plugwise-2-py / plugwise / protocol.py View on Github external
def unserialize(self, val):
        CompositeType.unserialize(self, val)
        self.value = datetime.time(self.hour.value, self.minute.value, self.second.value)
github SevenW / Plugwise-2-py / plugwise / protocol.py View on Github external
def unserialize(self, val):
        CompositeType.unserialize(self, val)
        try:
            self.value = datetime.date(self.year.value+PLUGWISE_EPOCH, self.month.value, self.day.value)
        except ValueError:
            debug('value error while attempting to construct DateStr object')
            self.value = None