Esempio n. 1
0
    def on_status_update(self, channel, callback):
        """
        Callback to execute on status of update of channel
        """
        self._callbacks.append(callback)

    def get_categories(self, channel):
        return ['sensor']

    def get_state(self, channel):
        """
        Ignore channel
        """
        return self._cur

    def get_class(self, channel):
        """
        Ignore channel
        """
        return 'temperature'

    def get_unit(self, channel):
        """
        Ignore channel
        """
        return '°C'


velbus.register_module('VMBIRO', VMBIROModule)
Esempio n. 2
0
    def on_status_update(self, channel, callback):
        """
        Callback to execute on status of update of channel
        """
        self._callbacks.append(callback)

    def get_categories(self, channel):
        return ['sensor']

    def get_state(self, channel):
        """
        Ignore channel
        """
        return self._cur

    def get_class(self, channel):
        """
        Ignore channel
        """
        return 'temperature'

    def get_unit(self, channel):
        """
        Ignore channel
        """
        return '°C'


velbus.register_module('VMBMETEO', VMBMETEOModule)
Esempio n. 3
0
        """
        if callback is None:

            def callb():
                """No-op"""
                pass

            callback = callb
        message = velbus.SwitchRelayOffMessage(self._address)
        message.relay_channels = [channel]
        self._controller.send(message, callback)

    def _on_message(self, message):
        if isinstance(message, velbus.RelayStatusMessage):
            self._is_on[message.channel] = message.is_on()
            if message.channel in self._callbacks:
                for callback in self._callbacks[message.channel]:
                    callback(message.is_on())

    def on_status_update(self, channel, callback):
        """
        Callback to execute on status of update of channel
        """
        if not channel in self._callbacks:
            self._callbacks[channel] = []
        self._callbacks[channel].append(callback)


velbus.register_module('VMB4RYLD', VMB4RYModule)
velbus.register_module('VMB4RYNO', VMB4RYModule)
Esempio n. 4
0
            for channel in message.get_channels():
                if channel in self._callbacks:
                    for callback in self._callbacks[channel]:
                        callback(self._is_closed[channel])
        elif isinstance(message, velbus.ModuleStatusMessage):
            for channel in list(range(1, self.number_of_channels() + 1)):
                if channel in message.closed:
                    self._is_closed[channel] = True
                else:
                    self._is_closed[channel] = False

    def on_status_update(self, channel, callback):
        """
        Callback to execute on status of update of channel
        """
        if not channel in self._callbacks:
            self._callbacks[channel] = []
        self._callbacks[channel].append(callback)


class VMB7INModule(VMB6INModule):
    """
    Velbus input module with 7 channels
    """
    def number_of_channels(self):
        return 8


velbus.register_module('VMB7IN', VMB7INModule)
velbus.register_module('VMB6IN', VMB6INModule)
Esempio n. 5
0
                if channel in message.enabled:
                    self._is_enabled[channel] = True
                else:
                    self._is_enabled[channel] = False

    def on_status_update(self, channel, callback):
        """
        Callback to execute on status of update of channel
        """
        if not channel in self._callbacks:
            self._callbacks[channel] = []
        self._callbacks[channel].append(callback)

    def get_categories(self, channel):
        if channel in self._is_enabled and self._is_enabled[channel]:
            return ['binary_sensor']
        else:
            return []


class VMB6PBNModule(VMB2PBNModule):
    """
    Velbus input module with 7 channels
    """
    def number_of_channels(self):
        return 6


velbus.register_module('VMB2PBN', VMB2PBNModule)
velbus.register_module('VMB6PBN', VMB6PBNModule)
Esempio n. 6
0
    def on_status_update(self, channel, callback):
        """
        Callback to execute on status of update of channel
        """
        self._callbacks.append(callback)

    def get_categories(self, channel):
        return ['sensor']

    def get_state(self, channel):
        """
        Ignore channel
        """
        return self._cur

    def get_class(self, channel):
        """
        Ignore channel
        """
        return 'temperature'

    def get_unit(self, channel):
        """
        Ignore channel
        """
        return '°C'


velbus.register_module('VMB1TS', VMB1TSModule)
Esempio n. 7
0
        """
        Callback to execute on status of update of channel
        """
        if not channel in self._callbacks:
            self._callbacks[channel] = []
        self._callbacks[channel].append(callback)

    def get_categories(self, channel):
        return ['binary_sensor']

class VMB2BLModule(VMB1BLModule):
    """
    Velbus input module with 7 channels
    """
    def number_of_channels(self):
        return 2

class VMB1BLEModule(velbus.Module):
    def number_of_channels(self):
        return 1

class VMB2BLEModule(velbus.Module):
    def number_of_channels(self):
        return 2


velbus.register_module('VMB1BL', VMB1BLModule)
velbus.register_module('VMB2BL', VMB2BLModule)
velbus.register_module('VMB1BLE', VMB1BLEModule)
velbus.register_module('VMB2BLE', VMB2BLEModule)
Esempio n. 8
0
        elif isinstance(message, velbus.ModuleStatusMessage2):
            for channel in list(range(1, self.number_of_channels() + 1)):
                if channel in message.closed:
                    self._is_closed[channel] = True
                else:
                    self._is_closed[channel] = False
                if channel in message.enabled:
                    self._is_enabled[channel] = True
                else:
                    self._is_enabled[channel] = False

    def on_status_update(self, channel, callback):
        """
        Callback to execute on status of update of channel
        """
        if not channel in self._callbacks:
            self._callbacks[channel] = []
        self._callbacks[channel].append(callback)

    def get_categories(self, channel):
        if channel in self._is_enabled and self._is_enabled[channel]:
            return ['binary_sensor']
        else:
            return []

velbus.register_module('VMBGP1', VMBGPxModule)
velbus.register_module('VMBGP2', VMBGPxModule)
velbus.register_module('VMBGP4', VMBGPxModule)
velbus.register_module('VMBGP0', VMBGPxModule)
velbus.register_module('VMBGPOD', VMBGPxModule)