def update(self):
        if self._coil:
            result = modbus.NETWORK.read_coils(self.register, 1)
            self.register_value = result.bits[0]
            self._is_on = self.register_value
        else:
            result = modbus.NETWORK.read_holding_registers(
                unit=self.slave, address=self.register,
                count=1)
            val = 0
            for i, res in enumerate(result.registers):
                val += res * (2**(i*16))
            self.register_value = val
            self._is_on = (val & (0x0001 << self.bit) > 0)
make the LP equation D matrix and d' vector (Da=d')
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/switch/modbus.py/ModbusSwitch.update--crossover with--dataset/ETHPy150Open jjhelmus/nmrglue/nmrglue/process/proc_lp.py/make_Dd