@mock.patch.object(nx584.NX584ZoneSensor, 'update_ha_state')
    def test_process_zone_event(self, mock_update):
        zone1 = {'number': 1, 'name': 'foo', 'state': True}
        zone2 = {'number': 2, 'name': 'bar', 'state': True}
        zones = {
            1: nx584.NX584ZoneSensor(zone1, 'motion'),
            2: nx584.NX584ZoneSensor(zone2, 'motion'),
        }
        watcher = nx584.NX584Watcher(None, zones)
        watcher._process_zone_event({'zone': 1, 'zone_state': False})
        self.assertFalse(zone1['state'])
        self.assertEqual(1, mock_update.call_count)
Test the processing of zone events.
dataset/ETHPy150Open home-assistant/home-assistant/tests/components/binary_sensor/test_nx584.py/TestNX584Watcher.test_process_zone_event