def test_ep_channels_all_channels(m1, zha_device_mock): """Test EndpointChannels adding all channels.""" zha_device = zha_device_mock( { 1: { SIG_EP_INPUT: [0, 1, 6, 8], SIG_EP_OUTPUT: [], SIG_EP_TYPE: zigpy.profiles.zha.DeviceType.ON_OFF_SWITCH, }, 2: { SIG_EP_INPUT: [0, 1, 6, 8, 768], SIG_EP_OUTPUT: [], SIG_EP_TYPE: 0x0000, }, } ) channels = zha_channels.Channels(zha_device) ep_channels = zha_channels.ChannelPool.new(channels, 1) assert "1:0x0000" in ep_channels.all_channels assert "1:0x0001" in ep_channels.all_channels assert "1:0x0006" in ep_channels.all_channels assert "1:0x0008" in ep_channels.all_channels assert "1:0x0300" not in ep_channels.all_channels assert "2:0x0000" not in ep_channels.all_channels assert "2:0x0001" not in ep_channels.all_channels assert "2:0x0006" not in ep_channels.all_channels assert "2:0x0008" not in ep_channels.all_channels assert "2:0x0300" not in ep_channels.all_channels channels = zha_channels.Channels(zha_device) ep_channels = zha_channels.ChannelPool.new(channels, 2) assert "1:0x0000" not in ep_channels.all_channels assert "1:0x0001" not in ep_channels.all_channels assert "1:0x0006" not in ep_channels.all_channels assert "1:0x0008" not in ep_channels.all_channels assert "1:0x0300" not in ep_channels.all_channels assert "2:0x0000" in ep_channels.all_channels assert "2:0x0001" in ep_channels.all_channels assert "2:0x0006" in ep_channels.all_channels assert "2:0x0008" in ep_channels.all_channels assert "2:0x0300" in ep_channels.all_channels
def test_ep_channels_all_channels(m1, zha_device_mock): """Test EndpointChannels adding all channels.""" zha_device = zha_device_mock( { 1: { "in_clusters": [0, 1, 6, 8], "out_clusters": [], "device_type": zigpy.profiles.zha.DeviceType.ON_OFF_SWITCH, }, 2: { "in_clusters": [0, 1, 6, 8, 768], "out_clusters": [], "device_type": 0x0000, }, } ) channels = zha_channels.Channels(zha_device) ep_channels = zha_channels.ChannelPool.new(channels, 1) assert "1:0x0000" in ep_channels.all_channels assert "1:0x0001" in ep_channels.all_channels assert "1:0x0006" in ep_channels.all_channels assert "1:0x0008" in ep_channels.all_channels assert "1:0x0300" not in ep_channels.all_channels assert "2:0x0000" not in ep_channels.all_channels assert "2:0x0001" not in ep_channels.all_channels assert "2:0x0006" not in ep_channels.all_channels assert "2:0x0008" not in ep_channels.all_channels assert "2:0x0300" not in ep_channels.all_channels channels = zha_channels.Channels(zha_device) ep_channels = zha_channels.ChannelPool.new(channels, 2) assert "1:0x0000" not in ep_channels.all_channels assert "1:0x0001" not in ep_channels.all_channels assert "1:0x0006" not in ep_channels.all_channels assert "1:0x0008" not in ep_channels.all_channels assert "1:0x0300" not in ep_channels.all_channels assert "2:0x0000" in ep_channels.all_channels assert "2:0x0001" in ep_channels.all_channels assert "2:0x0006" in ep_channels.all_channels assert "2:0x0008" in ep_channels.all_channels assert "2:0x0300" in ep_channels.all_channels