'Test the setup with full configuration.'

@mock.patch('homeassistant.components.binary_sensor.nx584.NX584Watcher')
@mock.patch('homeassistant.components.binary_sensor.nx584.NX584ZoneSensor')
def test_setup_full_config(self, mock_nx, mock_watcher):

    config = {'host': 'foo', 'port': 123, 'exclude_zones': [2], 'zone_types': {3: 'motion'}}
    add_devices = mock.MagicMock()
    self.assertTrue(nx584.setup_platform(self.hass, config, add_devices))
    mock_nx.assert_has_calls([mock.call(self.fake_zones[0], 'opening'), mock.call(self.fake_zones[2], 'motion')])
    self.assertTrue(add_devices.called)
    self.assertEqual(nx584_client.Client.call_count, 1)
    self.assertEqual(nx584_client.Client.call_args, mock.call('http://foo:123'))
    self.assertTrue(mock_watcher.called)
