'Initialize switch.'

def __init__(self, board, address, channel, name, invert_logic, initial_state):

    self._board = board
    self._address = address
    self._channel = channel
    self._name = (name or DEVICE_DEFAULT_NAME)
    self._invert_logic = invert_logic
    if (initial_state is not None):
        if self._invert_logic:
            state = (not initial_state)
        else:
            state = initial_state
        self.I2C_HATS_MANAGER.write_dq(self._address, self._channel, state)
    def online_callback():
        'Callback    fired    when    board    is    online.'
        self.schedule_update_ha_state()
    self.I2C_HATS_MANAGER.register_online_callback(self._address, self._channel, online_callback)
