diff --git a/homeassistant/components/wled/quality_scale.yaml b/homeassistant/components/wled/quality_scale.yaml index bfade448f0c9fe..11a59bcc6d97f9 100644 --- a/homeassistant/components/wled/quality_scale.yaml +++ b/homeassistant/components/wled/quality_scale.yaml @@ -6,10 +6,7 @@ rules: appropriate-polling: done brands: done common-modules: done - config-flow-test-coverage: - status: todo - comment: | - test_connection_error and test_unsupported_version_error should end in CREATE_ENTRY + config-flow-test-coverage: done config-flow: done dependency-transparency: done docs-actions: @@ -38,13 +35,7 @@ rules: status: exempt comment: | This integration does not require authentication. - test-coverage: - status: todo - comment: | - The test_setting_unique_id test is redundant. - The test_websocket_already_connected test can use the freezer. - The snapshot tests should be used more widely. - We should use pytest.mark.freeze_time instead of mock. + test-coverage: done # Gold devices: done diagnostics: done diff --git a/tests/components/wled/snapshots/test_button.ambr b/tests/components/wled/snapshots/test_button.ambr index b7bb8a1eea1310..7564a430db7b2e 100644 --- a/tests/components/wled/snapshots/test_button.ambr +++ b/tests/components/wled/snapshots/test_button.ambr @@ -1,19 +1,40 @@ # serializer version: 1 -# name: test_button_restart - StateSnapshot({ - 'attributes': ReadOnlyDict({ - 'device_class': 'restart', - 'friendly_name': 'WLED RGB Light Restart', +# name: test_device_snapshot + DeviceRegistryEntrySnapshot({ + 'area_id': None, + 'config_entries': , + 'config_entries_subentries': , + 'configuration_url': 'http://127.0.0.1', + 'connections': set({ + tuple( + 'mac', + 'aa:bb:cc:dd:ee:ff', + ), }), - 'context': , - 'entity_id': 'button.wled_rgb_light_restart', - 'last_changed': , - 'last_reported': , - 'last_updated': , - 'state': 'unknown', + 'disabled_by': None, + 'entry_type': None, + 'hw_version': 'esp32', + 'id': , + 'identifiers': set({ + tuple( + 'wled', + 'aabbccddeeff', + ), + }), + 'labels': set({ + }), + 'manufacturer': 'WLED', + 'model': 'FOSS', + 'model_id': None, + 'name': 'WLED RGB Light', + 'name_by_user': None, + 'primary_config_entry': , + 'serial_number': None, + 'sw_version': '0.14.4', + 'via_device_id': None, }) # --- -# name: test_button_restart.1 +# name: test_snapshots[button.wled_rgb_light_restart-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -48,38 +69,17 @@ 'unit_of_measurement': None, }) # --- -# name: test_button_restart.2 - DeviceRegistryEntrySnapshot({ - 'area_id': None, - 'config_entries': , - 'config_entries_subentries': , - 'configuration_url': 'http://127.0.0.1', - 'connections': set({ - tuple( - 'mac', - 'aa:bb:cc:dd:ee:ff', - ), - }), - 'disabled_by': None, - 'entry_type': None, - 'hw_version': 'esp32', - 'id': , - 'identifiers': set({ - tuple( - 'wled', - 'aabbccddeeff', - ), - }), - 'labels': set({ +# name: test_snapshots[button.wled_rgb_light_restart-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'restart', + 'friendly_name': 'WLED RGB Light Restart', }), - 'manufacturer': 'WLED', - 'model': 'FOSS', - 'model_id': None, - 'name': 'WLED RGB Light', - 'name_by_user': None, - 'primary_config_entry': , - 'serial_number': None, - 'sw_version': '0.14.4', - 'via_device_id': None, + 'context': , + 'entity_id': 'button.wled_rgb_light_restart', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', }) # --- diff --git a/tests/components/wled/snapshots/test_light.ambr b/tests/components/wled/snapshots/test_light.ambr new file mode 100644 index 00000000000000..d9369a4c6f23ae --- /dev/null +++ b/tests/components/wled/snapshots/test_light.ambr @@ -0,0 +1,2778 @@ +# serializer version: 1 +# name: test_snapshots[cct][light.wled_cct_light-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'effect_list': list([ + 'Solid', + 'Blink', + 'Breathe', + 'Wipe', + 'Wipe Random', + 'Random Colors', + 'Sweep', + 'Dynamic', + 'Colorloop', + 'Rainbow', + 'Scan', + 'Scan Dual', + 'Fade', + 'Theater', + 'Theater Rainbow', + 'Running', + 'Saw', + 'Twinkle', + 'Dissolve', + 'Dissolve Rnd', + 'Sparkle', + 'Sparkle Dark', + 'Sparkle+', + 'Strobe', + 'Strobe Rainbow', + 'Strobe Mega', + 'Blink Rainbow', + 'Android', + 'Chase', + 'Chase Random', + 'Chase Rainbow', + 'Chase Flash', + 'Chase Flash Rnd', + 'Rainbow Runner', + 'Colorful', + 'Traffic Light', + 'Sweep Random', + 'Chase 2', + 'Aurora', + 'Stream', + 'Scanner', + 'Lighthouse', + 'Fireworks', + 'Rain', + 'Tetrix', + 'Fire Flicker', + 'Gradient', + 'Loading', + 'Rolling Balls', + 'Fairy', + 'Two Dots', + 'Fairytwinkle', + 'Running Dual', + 'RSVD', + 'Chase 3', + 'Tri Wipe', + 'Tri Fade', + 'Lightning', + 'ICU', + 'Multi Comet', + 'Scanner Dual', + 'Stream 2', + 'Oscillate', + 'Pride 2015', + 'Juggle', + 'Palette', + 'Fire 2012', + 'Colorwaves', + 'Bpm', + 'Fill Noise', + 'Noise 1', + 'Noise 2', + 'Noise 3', + 'Noise 4', + 'Colortwinkles', + 'Lake', + 'Meteor', + 'Meteor Smooth', + 'Railway', + 'Ripple', + 'Twinklefox', + 'Twinklecat', + 'Halloween Eyes', + 'Solid Pattern', + 'Solid Pattern Tri', + 'Spots', + 'Spots Fade', + 'Glitter', + 'Candle', + 'Fireworks Starburst', + 'Fireworks 1D', + 'Bouncing Balls', + 'Sinelon', + 'Sinelon Dual', + 'Sinelon Rainbow', + 'Popcorn', + 'Drip', + 'Plasma', + 'Percent', + 'Ripple Rainbow', + 'Heartbeat', + 'Pacifica', + 'Candle Multi', + 'Solid Glitter', + 'Sunrise', + 'Phased', + 'Twinkleup', + 'Noise Pal', + 'Sine', + 'Phased Noise', + 'Flow', + 'Chunchun', + 'Dancing Shadows', + 'Washing Machine', + 'Rotozoomer', + 'Blends', + 'TV Simulator', + 'Dynamic Smooth', + 'Spaceships', + 'Crazy Bees', + 'Ghost Rider', + 'Blobs', + 'Scrolling Text', + 'Drift Rose', + 'Distortion Waves', + 'Soap', + 'Octopus', + 'Waving Cell', + 'Pixels', + 'Pixelwave', + 'Juggles', + 'Matripix', + 'Gravimeter', + 'Plasmoid', + 'Puddles', + 'Midnoise', + 'Noisemeter', + 'Freqwave', + 'Freqmatrix', + 'GEQ', + 'Waterfall', + 'Freqpixels', + 'RSVD', + 'Noisefire', + 'Puddlepeak', + 'Noisemove', + 'Noise2D', + 'Perlin Move', + 'Ripple Peak', + 'Firenoise', + 'Squared Swirl', + 'RSVD', + 'DNA', + 'Matrix', + 'Metaballs', + 'Freqmap', + 'Gravcenter', + 'Gravcentric', + 'Gravfreq', + 'DJ Light', + 'Funky Plank', + 'RSVD', + 'Pulser', + 'Blurz', + 'Drift', + 'Waverly', + 'Sun Radiation', + 'Colored Bursts', + 'Julia', + 'RSVD', + 'RSVD', + 'RSVD', + 'Game Of Life', + 'Tartan', + 'Polar Lights', + 'Swirl', + 'Lissajous', + 'Frizzles', + 'Plasma Ball', + 'Flow Stripe', + 'Hiphotic', + 'Sindots', + 'DNA Spiral', + 'Black Hole', + 'Wavesins', + 'Rocktaves', + 'Akemi', + ]), + 'max_color_temp_kelvin': 6535, + 'max_mireds': 500, + 'min_color_temp_kelvin': 2000, + 'min_mireds': 153, + 'supported_color_modes': list([ + , + , + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'light', + 'entity_category': None, + 'entity_id': 'light.wled_cct_light', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': None, + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': , + 'translation_key': 'segment', + 'unique_id': 'aabbccddeeff_0', + 'unit_of_measurement': None, + }) +# --- +# name: test_snapshots[cct][light.wled_cct_light-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'brightness': 255, + 'color_mode': , + 'color_temp': 339, + 'color_temp_kelvin': 2942, + 'effect': 'Solid', + 'effect_list': list([ + 'Solid', + 'Blink', + 'Breathe', + 'Wipe', + 'Wipe Random', + 'Random Colors', + 'Sweep', + 'Dynamic', + 'Colorloop', + 'Rainbow', + 'Scan', + 'Scan Dual', + 'Fade', + 'Theater', + 'Theater Rainbow', + 'Running', + 'Saw', + 'Twinkle', + 'Dissolve', + 'Dissolve Rnd', + 'Sparkle', + 'Sparkle Dark', + 'Sparkle+', + 'Strobe', + 'Strobe Rainbow', + 'Strobe Mega', + 'Blink Rainbow', + 'Android', + 'Chase', + 'Chase Random', + 'Chase Rainbow', + 'Chase Flash', + 'Chase Flash Rnd', + 'Rainbow Runner', + 'Colorful', + 'Traffic Light', + 'Sweep Random', + 'Chase 2', + 'Aurora', + 'Stream', + 'Scanner', + 'Lighthouse', + 'Fireworks', + 'Rain', + 'Tetrix', + 'Fire Flicker', + 'Gradient', + 'Loading', + 'Rolling Balls', + 'Fairy', + 'Two Dots', + 'Fairytwinkle', + 'Running Dual', + 'RSVD', + 'Chase 3', + 'Tri Wipe', + 'Tri Fade', + 'Lightning', + 'ICU', + 'Multi Comet', + 'Scanner Dual', + 'Stream 2', + 'Oscillate', + 'Pride 2015', + 'Juggle', + 'Palette', + 'Fire 2012', + 'Colorwaves', + 'Bpm', + 'Fill Noise', + 'Noise 1', + 'Noise 2', + 'Noise 3', + 'Noise 4', + 'Colortwinkles', + 'Lake', + 'Meteor', + 'Meteor Smooth', + 'Railway', + 'Ripple', + 'Twinklefox', + 'Twinklecat', + 'Halloween Eyes', + 'Solid Pattern', + 'Solid Pattern Tri', + 'Spots', + 'Spots Fade', + 'Glitter', + 'Candle', + 'Fireworks Starburst', + 'Fireworks 1D', + 'Bouncing Balls', + 'Sinelon', + 'Sinelon Dual', + 'Sinelon Rainbow', + 'Popcorn', + 'Drip', + 'Plasma', + 'Percent', + 'Ripple Rainbow', + 'Heartbeat', + 'Pacifica', + 'Candle Multi', + 'Solid Glitter', + 'Sunrise', + 'Phased', + 'Twinkleup', + 'Noise Pal', + 'Sine', + 'Phased Noise', + 'Flow', + 'Chunchun', + 'Dancing Shadows', + 'Washing Machine', + 'Rotozoomer', + 'Blends', + 'TV Simulator', + 'Dynamic Smooth', + 'Spaceships', + 'Crazy Bees', + 'Ghost Rider', + 'Blobs', + 'Scrolling Text', + 'Drift Rose', + 'Distortion Waves', + 'Soap', + 'Octopus', + 'Waving Cell', + 'Pixels', + 'Pixelwave', + 'Juggles', + 'Matripix', + 'Gravimeter', + 'Plasmoid', + 'Puddles', + 'Midnoise', + 'Noisemeter', + 'Freqwave', + 'Freqmatrix', + 'GEQ', + 'Waterfall', + 'Freqpixels', + 'RSVD', + 'Noisefire', + 'Puddlepeak', + 'Noisemove', + 'Noise2D', + 'Perlin Move', + 'Ripple Peak', + 'Firenoise', + 'Squared Swirl', + 'RSVD', + 'DNA', + 'Matrix', + 'Metaballs', + 'Freqmap', + 'Gravcenter', + 'Gravcentric', + 'Gravfreq', + 'DJ Light', + 'Funky Plank', + 'RSVD', + 'Pulser', + 'Blurz', + 'Drift', + 'Waverly', + 'Sun Radiation', + 'Colored Bursts', + 'Julia', + 'RSVD', + 'RSVD', + 'RSVD', + 'Game Of Life', + 'Tartan', + 'Polar Lights', + 'Swirl', + 'Lissajous', + 'Frizzles', + 'Plasma Ball', + 'Flow Stripe', + 'Hiphotic', + 'Sindots', + 'DNA Spiral', + 'Black Hole', + 'Wavesins', + 'Rocktaves', + 'Akemi', + ]), + 'friendly_name': 'WLED CCT light', + 'hs_color': tuple( + 27.924, + 58.494, + ), + 'max_color_temp_kelvin': 6535, + 'max_mireds': 500, + 'min_color_temp_kelvin': 2000, + 'min_mireds': 153, + 'rgb_color': tuple( + 255, + 175, + 106, + ), + 'rgbw_color': None, + 'supported_color_modes': list([ + , + , + ]), + 'supported_features': , + 'xy_color': tuple( + 0.501, + 0.384, + ), + }), + 'context': , + 'entity_id': 'light.wled_cct_light', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_snapshots[rgb][light.wled_rgb_light-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'effect_list': list([ + 'Solid', + 'Blink', + 'Breathe', + 'Wipe', + 'Wipe Random', + 'Random Colors', + 'Sweep', + 'Dynamic', + 'Colorloop', + 'Rainbow', + 'Scan', + 'Scan Dual', + 'Fade', + 'Theater', + 'Theater Rainbow', + 'Running', + 'Saw', + 'Twinkle', + 'Dissolve', + 'Dissolve Rnd', + 'Sparkle', + 'Sparkle Dark', + 'Sparkle+', + 'Strobe', + 'Strobe Rainbow', + 'Strobe Mega', + 'Blink Rainbow', + 'Android', + 'Chase', + 'Chase Random', + 'Chase Rainbow', + 'Chase Flash', + 'Chase Flash Rnd', + 'Rainbow Runner', + 'Colorful', + 'Traffic Light', + 'Sweep Random', + 'Chase 2', + 'Aurora', + 'Stream', + 'Scanner', + 'Lighthouse', + 'Fireworks', + 'Rain', + 'Tetrix', + 'Fire Flicker', + 'Gradient', + 'Loading', + 'Rolling Balls', + 'Fairy', + 'Two Dots', + 'Fairytwinkle', + 'Running Dual', + 'RSVD', + 'Chase 3', + 'Tri Wipe', + 'Tri Fade', + 'Lightning', + 'ICU', + 'Multi Comet', + 'Scanner Dual', + 'Stream 2', + 'Oscillate', + 'Pride 2015', + 'Juggle', + 'Palette', + 'Fire 2012', + 'Colorwaves', + 'Bpm', + 'Fill Noise', + 'Noise 1', + 'Noise 2', + 'Noise 3', + 'Noise 4', + 'Colortwinkles', + 'Lake', + 'Meteor', + 'Meteor Smooth', + 'Railway', + 'Ripple', + 'Twinklefox', + 'Twinklecat', + 'Halloween Eyes', + 'Solid Pattern', + 'Solid Pattern Tri', + 'Spots', + 'Spots Fade', + 'Glitter', + 'Candle', + 'Fireworks Starburst', + 'Fireworks 1D', + 'Bouncing Balls', + 'Sinelon', + 'Sinelon Dual', + 'Sinelon Rainbow', + 'Popcorn', + 'Drip', + 'Plasma', + 'Percent', + 'Ripple Rainbow', + 'Heartbeat', + 'Pacifica', + 'Candle Multi', + 'Solid Glitter', + 'Sunrise', + 'Phased', + 'Twinkleup', + 'Noise Pal', + 'Sine', + 'Phased Noise', + 'Flow', + 'Chunchun', + 'Dancing Shadows', + 'Washing Machine', + 'RSVD', + 'Blends', + 'TV Simulator', + 'Dynamic Smooth', + 'Spaceships', + 'Crazy Bees', + 'Ghost Rider', + 'Blobs', + 'Scrolling Text', + 'Drift Rose', + 'Distortion Waves', + 'Soap', + 'Octopus', + 'Waving Cell', + 'Pixels', + 'Pixelwave', + 'Juggles', + 'Matripix', + 'Gravimeter', + 'Plasmoid', + 'Puddles', + 'Midnoise', + 'Noisemeter', + 'Freqwave', + 'Freqmatrix', + 'GEQ', + 'Waterfall', + 'Freqpixels', + 'RSVD', + 'Noisefire', + 'Puddlepeak', + 'Noisemove', + 'Noise2D', + 'Perlin Move', + 'Ripple Peak', + 'Firenoise', + 'Squared Swirl', + 'RSVD', + 'DNA', + 'Matrix', + 'Metaballs', + 'Freqmap', + 'Gravcenter', + 'Gravcentric', + 'Gravfreq', + 'DJ Light', + 'Funky Plank', + 'RSVD', + 'Pulser', + 'Blurz', + 'Drift', + 'Waverly', + 'Sun Radiation', + 'Colored Bursts', + 'Julia', + 'RSVD', + 'RSVD', + 'RSVD', + 'Game Of Life', + 'Tartan', + 'Polar Lights', + 'Swirl', + 'Lissajous', + 'Frizzles', + 'Plasma Ball', + 'Flow Stripe', + 'Hiphotic', + 'Sindots', + 'DNA Spiral', + 'Black Hole', + 'Wavesins', + 'Rocktaves', + 'Akemi', + ]), + 'supported_color_modes': list([ + , + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'light', + 'entity_category': None, + 'entity_id': 'light.wled_rgb_light', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': None, + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': , + 'translation_key': 'segment', + 'unique_id': 'aabbccddeeff_0', + 'unit_of_measurement': None, + }) +# --- +# name: test_snapshots[rgb][light.wled_rgb_light-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'brightness': 255, + 'color_mode': , + 'effect': 'Solid', + 'effect_list': list([ + 'Solid', + 'Blink', + 'Breathe', + 'Wipe', + 'Wipe Random', + 'Random Colors', + 'Sweep', + 'Dynamic', + 'Colorloop', + 'Rainbow', + 'Scan', + 'Scan Dual', + 'Fade', + 'Theater', + 'Theater Rainbow', + 'Running', + 'Saw', + 'Twinkle', + 'Dissolve', + 'Dissolve Rnd', + 'Sparkle', + 'Sparkle Dark', + 'Sparkle+', + 'Strobe', + 'Strobe Rainbow', + 'Strobe Mega', + 'Blink Rainbow', + 'Android', + 'Chase', + 'Chase Random', + 'Chase Rainbow', + 'Chase Flash', + 'Chase Flash Rnd', + 'Rainbow Runner', + 'Colorful', + 'Traffic Light', + 'Sweep Random', + 'Chase 2', + 'Aurora', + 'Stream', + 'Scanner', + 'Lighthouse', + 'Fireworks', + 'Rain', + 'Tetrix', + 'Fire Flicker', + 'Gradient', + 'Loading', + 'Rolling Balls', + 'Fairy', + 'Two Dots', + 'Fairytwinkle', + 'Running Dual', + 'RSVD', + 'Chase 3', + 'Tri Wipe', + 'Tri Fade', + 'Lightning', + 'ICU', + 'Multi Comet', + 'Scanner Dual', + 'Stream 2', + 'Oscillate', + 'Pride 2015', + 'Juggle', + 'Palette', + 'Fire 2012', + 'Colorwaves', + 'Bpm', + 'Fill Noise', + 'Noise 1', + 'Noise 2', + 'Noise 3', + 'Noise 4', + 'Colortwinkles', + 'Lake', + 'Meteor', + 'Meteor Smooth', + 'Railway', + 'Ripple', + 'Twinklefox', + 'Twinklecat', + 'Halloween Eyes', + 'Solid Pattern', + 'Solid Pattern Tri', + 'Spots', + 'Spots Fade', + 'Glitter', + 'Candle', + 'Fireworks Starburst', + 'Fireworks 1D', + 'Bouncing Balls', + 'Sinelon', + 'Sinelon Dual', + 'Sinelon Rainbow', + 'Popcorn', + 'Drip', + 'Plasma', + 'Percent', + 'Ripple Rainbow', + 'Heartbeat', + 'Pacifica', + 'Candle Multi', + 'Solid Glitter', + 'Sunrise', + 'Phased', + 'Twinkleup', + 'Noise Pal', + 'Sine', + 'Phased Noise', + 'Flow', + 'Chunchun', + 'Dancing Shadows', + 'Washing Machine', + 'RSVD', + 'Blends', + 'TV Simulator', + 'Dynamic Smooth', + 'Spaceships', + 'Crazy Bees', + 'Ghost Rider', + 'Blobs', + 'Scrolling Text', + 'Drift Rose', + 'Distortion Waves', + 'Soap', + 'Octopus', + 'Waving Cell', + 'Pixels', + 'Pixelwave', + 'Juggles', + 'Matripix', + 'Gravimeter', + 'Plasmoid', + 'Puddles', + 'Midnoise', + 'Noisemeter', + 'Freqwave', + 'Freqmatrix', + 'GEQ', + 'Waterfall', + 'Freqpixels', + 'RSVD', + 'Noisefire', + 'Puddlepeak', + 'Noisemove', + 'Noise2D', + 'Perlin Move', + 'Ripple Peak', + 'Firenoise', + 'Squared Swirl', + 'RSVD', + 'DNA', + 'Matrix', + 'Metaballs', + 'Freqmap', + 'Gravcenter', + 'Gravcentric', + 'Gravfreq', + 'DJ Light', + 'Funky Plank', + 'RSVD', + 'Pulser', + 'Blurz', + 'Drift', + 'Waverly', + 'Sun Radiation', + 'Colored Bursts', + 'Julia', + 'RSVD', + 'RSVD', + 'RSVD', + 'Game Of Life', + 'Tartan', + 'Polar Lights', + 'Swirl', + 'Lissajous', + 'Frizzles', + 'Plasma Ball', + 'Flow Stripe', + 'Hiphotic', + 'Sindots', + 'DNA Spiral', + 'Black Hole', + 'Wavesins', + 'Rocktaves', + 'Akemi', + ]), + 'friendly_name': 'WLED RGB Light', + 'hs_color': tuple( + 218.906, + 50.196, + ), + 'rgb_color': tuple( + 127, + 172, + 255, + ), + 'supported_color_modes': list([ + , + ]), + 'supported_features': , + 'xy_color': tuple( + 0.208, + 0.217, + ), + }), + 'context': , + 'entity_id': 'light.wled_rgb_light', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_snapshots[rgb][light.wled_rgb_light_main-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'supported_color_modes': list([ + , + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'light', + 'entity_category': None, + 'entity_id': 'light.wled_rgb_light_main', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Main', + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': , + 'translation_key': 'main', + 'unique_id': 'aabbccddeeff', + 'unit_of_measurement': None, + }) +# --- +# name: test_snapshots[rgb][light.wled_rgb_light_main-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'brightness': 128, + 'color_mode': , + 'friendly_name': 'WLED RGB Light Main', + 'supported_color_modes': list([ + , + ]), + 'supported_features': , + }), + 'context': , + 'entity_id': 'light.wled_rgb_light_main', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_snapshots[rgb][light.wled_rgb_light_segment_1-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'effect_list': list([ + 'Solid', + 'Blink', + 'Breathe', + 'Wipe', + 'Wipe Random', + 'Random Colors', + 'Sweep', + 'Dynamic', + 'Colorloop', + 'Rainbow', + 'Scan', + 'Scan Dual', + 'Fade', + 'Theater', + 'Theater Rainbow', + 'Running', + 'Saw', + 'Twinkle', + 'Dissolve', + 'Dissolve Rnd', + 'Sparkle', + 'Sparkle Dark', + 'Sparkle+', + 'Strobe', + 'Strobe Rainbow', + 'Strobe Mega', + 'Blink Rainbow', + 'Android', + 'Chase', + 'Chase Random', + 'Chase Rainbow', + 'Chase Flash', + 'Chase Flash Rnd', + 'Rainbow Runner', + 'Colorful', + 'Traffic Light', + 'Sweep Random', + 'Chase 2', + 'Aurora', + 'Stream', + 'Scanner', + 'Lighthouse', + 'Fireworks', + 'Rain', + 'Tetrix', + 'Fire Flicker', + 'Gradient', + 'Loading', + 'Rolling Balls', + 'Fairy', + 'Two Dots', + 'Fairytwinkle', + 'Running Dual', + 'RSVD', + 'Chase 3', + 'Tri Wipe', + 'Tri Fade', + 'Lightning', + 'ICU', + 'Multi Comet', + 'Scanner Dual', + 'Stream 2', + 'Oscillate', + 'Pride 2015', + 'Juggle', + 'Palette', + 'Fire 2012', + 'Colorwaves', + 'Bpm', + 'Fill Noise', + 'Noise 1', + 'Noise 2', + 'Noise 3', + 'Noise 4', + 'Colortwinkles', + 'Lake', + 'Meteor', + 'Meteor Smooth', + 'Railway', + 'Ripple', + 'Twinklefox', + 'Twinklecat', + 'Halloween Eyes', + 'Solid Pattern', + 'Solid Pattern Tri', + 'Spots', + 'Spots Fade', + 'Glitter', + 'Candle', + 'Fireworks Starburst', + 'Fireworks 1D', + 'Bouncing Balls', + 'Sinelon', + 'Sinelon Dual', + 'Sinelon Rainbow', + 'Popcorn', + 'Drip', + 'Plasma', + 'Percent', + 'Ripple Rainbow', + 'Heartbeat', + 'Pacifica', + 'Candle Multi', + 'Solid Glitter', + 'Sunrise', + 'Phased', + 'Twinkleup', + 'Noise Pal', + 'Sine', + 'Phased Noise', + 'Flow', + 'Chunchun', + 'Dancing Shadows', + 'Washing Machine', + 'RSVD', + 'Blends', + 'TV Simulator', + 'Dynamic Smooth', + 'Spaceships', + 'Crazy Bees', + 'Ghost Rider', + 'Blobs', + 'Scrolling Text', + 'Drift Rose', + 'Distortion Waves', + 'Soap', + 'Octopus', + 'Waving Cell', + 'Pixels', + 'Pixelwave', + 'Juggles', + 'Matripix', + 'Gravimeter', + 'Plasmoid', + 'Puddles', + 'Midnoise', + 'Noisemeter', + 'Freqwave', + 'Freqmatrix', + 'GEQ', + 'Waterfall', + 'Freqpixels', + 'RSVD', + 'Noisefire', + 'Puddlepeak', + 'Noisemove', + 'Noise2D', + 'Perlin Move', + 'Ripple Peak', + 'Firenoise', + 'Squared Swirl', + 'RSVD', + 'DNA', + 'Matrix', + 'Metaballs', + 'Freqmap', + 'Gravcenter', + 'Gravcentric', + 'Gravfreq', + 'DJ Light', + 'Funky Plank', + 'RSVD', + 'Pulser', + 'Blurz', + 'Drift', + 'Waverly', + 'Sun Radiation', + 'Colored Bursts', + 'Julia', + 'RSVD', + 'RSVD', + 'RSVD', + 'Game Of Life', + 'Tartan', + 'Polar Lights', + 'Swirl', + 'Lissajous', + 'Frizzles', + 'Plasma Ball', + 'Flow Stripe', + 'Hiphotic', + 'Sindots', + 'DNA Spiral', + 'Black Hole', + 'Wavesins', + 'Rocktaves', + 'Akemi', + ]), + 'supported_color_modes': list([ + , + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'light', + 'entity_category': None, + 'entity_id': 'light.wled_rgb_light_segment_1', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Segment 1', + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': , + 'translation_key': 'segment', + 'unique_id': 'aabbccddeeff_1', + 'unit_of_measurement': None, + }) +# --- +# name: test_snapshots[rgb][light.wled_rgb_light_segment_1-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'brightness': 255, + 'color_mode': , + 'effect': 'Wipe', + 'effect_list': list([ + 'Solid', + 'Blink', + 'Breathe', + 'Wipe', + 'Wipe Random', + 'Random Colors', + 'Sweep', + 'Dynamic', + 'Colorloop', + 'Rainbow', + 'Scan', + 'Scan Dual', + 'Fade', + 'Theater', + 'Theater Rainbow', + 'Running', + 'Saw', + 'Twinkle', + 'Dissolve', + 'Dissolve Rnd', + 'Sparkle', + 'Sparkle Dark', + 'Sparkle+', + 'Strobe', + 'Strobe Rainbow', + 'Strobe Mega', + 'Blink Rainbow', + 'Android', + 'Chase', + 'Chase Random', + 'Chase Rainbow', + 'Chase Flash', + 'Chase Flash Rnd', + 'Rainbow Runner', + 'Colorful', + 'Traffic Light', + 'Sweep Random', + 'Chase 2', + 'Aurora', + 'Stream', + 'Scanner', + 'Lighthouse', + 'Fireworks', + 'Rain', + 'Tetrix', + 'Fire Flicker', + 'Gradient', + 'Loading', + 'Rolling Balls', + 'Fairy', + 'Two Dots', + 'Fairytwinkle', + 'Running Dual', + 'RSVD', + 'Chase 3', + 'Tri Wipe', + 'Tri Fade', + 'Lightning', + 'ICU', + 'Multi Comet', + 'Scanner Dual', + 'Stream 2', + 'Oscillate', + 'Pride 2015', + 'Juggle', + 'Palette', + 'Fire 2012', + 'Colorwaves', + 'Bpm', + 'Fill Noise', + 'Noise 1', + 'Noise 2', + 'Noise 3', + 'Noise 4', + 'Colortwinkles', + 'Lake', + 'Meteor', + 'Meteor Smooth', + 'Railway', + 'Ripple', + 'Twinklefox', + 'Twinklecat', + 'Halloween Eyes', + 'Solid Pattern', + 'Solid Pattern Tri', + 'Spots', + 'Spots Fade', + 'Glitter', + 'Candle', + 'Fireworks Starburst', + 'Fireworks 1D', + 'Bouncing Balls', + 'Sinelon', + 'Sinelon Dual', + 'Sinelon Rainbow', + 'Popcorn', + 'Drip', + 'Plasma', + 'Percent', + 'Ripple Rainbow', + 'Heartbeat', + 'Pacifica', + 'Candle Multi', + 'Solid Glitter', + 'Sunrise', + 'Phased', + 'Twinkleup', + 'Noise Pal', + 'Sine', + 'Phased Noise', + 'Flow', + 'Chunchun', + 'Dancing Shadows', + 'Washing Machine', + 'RSVD', + 'Blends', + 'TV Simulator', + 'Dynamic Smooth', + 'Spaceships', + 'Crazy Bees', + 'Ghost Rider', + 'Blobs', + 'Scrolling Text', + 'Drift Rose', + 'Distortion Waves', + 'Soap', + 'Octopus', + 'Waving Cell', + 'Pixels', + 'Pixelwave', + 'Juggles', + 'Matripix', + 'Gravimeter', + 'Plasmoid', + 'Puddles', + 'Midnoise', + 'Noisemeter', + 'Freqwave', + 'Freqmatrix', + 'GEQ', + 'Waterfall', + 'Freqpixels', + 'RSVD', + 'Noisefire', + 'Puddlepeak', + 'Noisemove', + 'Noise2D', + 'Perlin Move', + 'Ripple Peak', + 'Firenoise', + 'Squared Swirl', + 'RSVD', + 'DNA', + 'Matrix', + 'Metaballs', + 'Freqmap', + 'Gravcenter', + 'Gravcentric', + 'Gravfreq', + 'DJ Light', + 'Funky Plank', + 'RSVD', + 'Pulser', + 'Blurz', + 'Drift', + 'Waverly', + 'Sun Radiation', + 'Colored Bursts', + 'Julia', + 'RSVD', + 'RSVD', + 'RSVD', + 'Game Of Life', + 'Tartan', + 'Polar Lights', + 'Swirl', + 'Lissajous', + 'Frizzles', + 'Plasma Ball', + 'Flow Stripe', + 'Hiphotic', + 'Sindots', + 'DNA Spiral', + 'Black Hole', + 'Wavesins', + 'Rocktaves', + 'Akemi', + ]), + 'friendly_name': 'WLED RGB Light Segment 1', + 'hs_color': tuple( + 40.0, + 100.0, + ), + 'rgb_color': tuple( + 255, + 170, + 0, + ), + 'supported_color_modes': list([ + , + ]), + 'supported_features': , + 'xy_color': tuple( + 0.555, + 0.422, + ), + }), + 'context': , + 'entity_id': 'light.wled_rgb_light_segment_1', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_snapshots[rgb_single_segment][light.wled_rgb_light-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'effect_list': list([ + 'Solid', + 'Blink', + 'Breathe', + 'Wipe', + 'Wipe Random', + 'Random Colors', + 'Sweep', + 'Dynamic', + 'Colorloop', + 'Rainbow', + 'Scan', + 'Scan Dual', + 'Fade', + 'Theater', + 'Theater Rainbow', + 'Running', + 'Saw', + 'Twinkle', + 'Dissolve', + 'Dissolve Rnd', + 'Sparkle', + 'Sparkle Dark', + 'Sparkle+', + 'Strobe', + 'Strobe Rainbow', + 'Strobe Mega', + 'Blink Rainbow', + 'Android', + 'Chase', + 'Chase Random', + 'Chase Rainbow', + 'Chase Flash', + 'Chase Flash Rnd', + 'Rainbow Runner', + 'Colorful', + 'Traffic Light', + 'Sweep Random', + 'Chase 2', + 'Aurora', + 'Stream', + 'Scanner', + 'Lighthouse', + 'Fireworks', + 'Rain', + 'Tetrix', + 'Fire Flicker', + 'Gradient', + 'Loading', + 'Rolling Balls', + 'Fairy', + 'Two Dots', + 'Fairytwinkle', + 'Running Dual', + 'RSVD', + 'Chase 3', + 'Tri Wipe', + 'Tri Fade', + 'Lightning', + 'ICU', + 'Multi Comet', + 'Scanner Dual', + 'Stream 2', + 'Oscillate', + 'Pride 2015', + 'Juggle', + 'Palette', + 'Fire 2012', + 'Colorwaves', + 'Bpm', + 'Fill Noise', + 'Noise 1', + 'Noise 2', + 'Noise 3', + 'Noise 4', + 'Colortwinkles', + 'Lake', + 'Meteor', + 'Meteor Smooth', + 'Railway', + 'Ripple', + 'Twinklefox', + 'Twinklecat', + 'Halloween Eyes', + 'Solid Pattern', + 'Solid Pattern Tri', + 'Spots', + 'Spots Fade', + 'Glitter', + 'Candle', + 'Fireworks Starburst', + 'Fireworks 1D', + 'Bouncing Balls', + 'Sinelon', + 'Sinelon Dual', + 'Sinelon Rainbow', + 'Popcorn', + 'Drip', + 'Plasma', + 'Percent', + 'Ripple Rainbow', + 'Heartbeat', + 'Pacifica', + 'Candle Multi', + 'Solid Glitter', + 'Sunrise', + 'Phased', + 'Twinkleup', + 'Noise Pal', + 'Sine', + 'Phased Noise', + 'Flow', + 'Chunchun', + 'Dancing Shadows', + 'Washing Machine', + 'RSVD', + 'Blends', + 'TV Simulator', + 'Dynamic Smooth', + 'Spaceships', + 'Crazy Bees', + 'Ghost Rider', + 'Blobs', + 'Scrolling Text', + 'Drift Rose', + 'Distortion Waves', + 'Soap', + 'Octopus', + 'Waving Cell', + 'Pixels', + 'Pixelwave', + 'Juggles', + 'Matripix', + 'Gravimeter', + 'Plasmoid', + 'Puddles', + 'Midnoise', + 'Noisemeter', + 'Freqwave', + 'Freqmatrix', + 'GEQ', + 'Waterfall', + 'Freqpixels', + 'RSVD', + 'Noisefire', + 'Puddlepeak', + 'Noisemove', + 'Noise2D', + 'Perlin Move', + 'Ripple Peak', + 'Firenoise', + 'Squared Swirl', + 'RSVD', + 'DNA', + 'Matrix', + 'Metaballs', + 'Freqmap', + 'Gravcenter', + 'Gravcentric', + 'Gravfreq', + 'DJ Light', + 'Funky Plank', + 'RSVD', + 'Pulser', + 'Blurz', + 'Drift', + 'Waverly', + 'Sun Radiation', + 'Colored Bursts', + 'Julia', + 'RSVD', + 'RSVD', + 'RSVD', + 'Game Of Life', + 'Tartan', + 'Polar Lights', + 'Swirl', + 'Lissajous', + 'Frizzles', + 'Plasma Ball', + 'Flow Stripe', + 'Hiphotic', + 'Sindots', + 'DNA Spiral', + 'Black Hole', + 'Wavesins', + 'Rocktaves', + 'Akemi', + ]), + 'supported_color_modes': list([ + , + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'light', + 'entity_category': None, + 'entity_id': 'light.wled_rgb_light', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': None, + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': , + 'translation_key': 'segment', + 'unique_id': 'aabbccddeeff_0', + 'unit_of_measurement': None, + }) +# --- +# name: test_snapshots[rgb_single_segment][light.wled_rgb_light-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'brightness': 128, + 'color_mode': , + 'effect': 'Solid', + 'effect_list': list([ + 'Solid', + 'Blink', + 'Breathe', + 'Wipe', + 'Wipe Random', + 'Random Colors', + 'Sweep', + 'Dynamic', + 'Colorloop', + 'Rainbow', + 'Scan', + 'Scan Dual', + 'Fade', + 'Theater', + 'Theater Rainbow', + 'Running', + 'Saw', + 'Twinkle', + 'Dissolve', + 'Dissolve Rnd', + 'Sparkle', + 'Sparkle Dark', + 'Sparkle+', + 'Strobe', + 'Strobe Rainbow', + 'Strobe Mega', + 'Blink Rainbow', + 'Android', + 'Chase', + 'Chase Random', + 'Chase Rainbow', + 'Chase Flash', + 'Chase Flash Rnd', + 'Rainbow Runner', + 'Colorful', + 'Traffic Light', + 'Sweep Random', + 'Chase 2', + 'Aurora', + 'Stream', + 'Scanner', + 'Lighthouse', + 'Fireworks', + 'Rain', + 'Tetrix', + 'Fire Flicker', + 'Gradient', + 'Loading', + 'Rolling Balls', + 'Fairy', + 'Two Dots', + 'Fairytwinkle', + 'Running Dual', + 'RSVD', + 'Chase 3', + 'Tri Wipe', + 'Tri Fade', + 'Lightning', + 'ICU', + 'Multi Comet', + 'Scanner Dual', + 'Stream 2', + 'Oscillate', + 'Pride 2015', + 'Juggle', + 'Palette', + 'Fire 2012', + 'Colorwaves', + 'Bpm', + 'Fill Noise', + 'Noise 1', + 'Noise 2', + 'Noise 3', + 'Noise 4', + 'Colortwinkles', + 'Lake', + 'Meteor', + 'Meteor Smooth', + 'Railway', + 'Ripple', + 'Twinklefox', + 'Twinklecat', + 'Halloween Eyes', + 'Solid Pattern', + 'Solid Pattern Tri', + 'Spots', + 'Spots Fade', + 'Glitter', + 'Candle', + 'Fireworks Starburst', + 'Fireworks 1D', + 'Bouncing Balls', + 'Sinelon', + 'Sinelon Dual', + 'Sinelon Rainbow', + 'Popcorn', + 'Drip', + 'Plasma', + 'Percent', + 'Ripple Rainbow', + 'Heartbeat', + 'Pacifica', + 'Candle Multi', + 'Solid Glitter', + 'Sunrise', + 'Phased', + 'Twinkleup', + 'Noise Pal', + 'Sine', + 'Phased Noise', + 'Flow', + 'Chunchun', + 'Dancing Shadows', + 'Washing Machine', + 'RSVD', + 'Blends', + 'TV Simulator', + 'Dynamic Smooth', + 'Spaceships', + 'Crazy Bees', + 'Ghost Rider', + 'Blobs', + 'Scrolling Text', + 'Drift Rose', + 'Distortion Waves', + 'Soap', + 'Octopus', + 'Waving Cell', + 'Pixels', + 'Pixelwave', + 'Juggles', + 'Matripix', + 'Gravimeter', + 'Plasmoid', + 'Puddles', + 'Midnoise', + 'Noisemeter', + 'Freqwave', + 'Freqmatrix', + 'GEQ', + 'Waterfall', + 'Freqpixels', + 'RSVD', + 'Noisefire', + 'Puddlepeak', + 'Noisemove', + 'Noise2D', + 'Perlin Move', + 'Ripple Peak', + 'Firenoise', + 'Squared Swirl', + 'RSVD', + 'DNA', + 'Matrix', + 'Metaballs', + 'Freqmap', + 'Gravcenter', + 'Gravcentric', + 'Gravfreq', + 'DJ Light', + 'Funky Plank', + 'RSVD', + 'Pulser', + 'Blurz', + 'Drift', + 'Waverly', + 'Sun Radiation', + 'Colored Bursts', + 'Julia', + 'RSVD', + 'RSVD', + 'RSVD', + 'Game Of Life', + 'Tartan', + 'Polar Lights', + 'Swirl', + 'Lissajous', + 'Frizzles', + 'Plasma Ball', + 'Flow Stripe', + 'Hiphotic', + 'Sindots', + 'DNA Spiral', + 'Black Hole', + 'Wavesins', + 'Rocktaves', + 'Akemi', + ]), + 'friendly_name': 'WLED RGB Light', + 'hs_color': tuple( + 218.906, + 50.196, + ), + 'rgb_color': tuple( + 127, + 172, + 255, + ), + 'supported_color_modes': list([ + , + ]), + 'supported_features': , + 'xy_color': tuple( + 0.208, + 0.217, + ), + }), + 'context': , + 'entity_id': 'light.wled_rgb_light', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_snapshots[rgb_websocket][light.wled_websocket-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'effect_list': list([ + 'Solid', + 'Blink', + 'Breathe', + 'Wipe', + 'Wipe Random', + 'Random Colors', + 'Sweep', + 'Dynamic', + 'Colorloop', + 'Rainbow', + 'Scan', + 'Scan Dual', + 'Fade', + 'Theater', + 'Theater Rainbow', + 'Running', + 'Saw', + 'Twinkle', + 'Dissolve', + 'Dissolve Rnd', + 'Sparkle', + 'Sparkle Dark', + 'Sparkle+', + 'Strobe', + 'Strobe Rainbow', + 'Strobe Mega', + 'Blink Rainbow', + 'Android', + 'Chase', + 'Chase Random', + 'Chase Rainbow', + 'Chase Flash', + 'Chase Flash Rnd', + 'Rainbow Runner', + 'Colorful', + 'Traffic Light', + 'Sweep Random', + 'Chase 2', + 'Aurora', + 'Stream', + 'Scanner', + 'Lighthouse', + 'Fireworks', + 'Rain', + 'Tetrix', + 'Fire Flicker', + 'Gradient', + 'Loading', + 'Rolling Balls', + 'Fairy', + 'Two Dots', + 'Fairytwinkle', + 'Running Dual', + 'RSVD', + 'Chase 3', + 'Tri Wipe', + 'Tri Fade', + 'Lightning', + 'ICU', + 'Multi Comet', + 'Scanner Dual', + 'Stream 2', + 'Oscillate', + 'Pride 2015', + 'Juggle', + 'Palette', + 'Fire 2012', + 'Colorwaves', + 'Bpm', + 'Fill Noise', + 'Noise 1', + 'Noise 2', + 'Noise 3', + 'Noise 4', + 'Colortwinkles', + 'Lake', + 'Meteor', + 'Meteor Smooth', + 'Railway', + 'Ripple', + 'Twinklefox', + 'Twinklecat', + 'Halloween Eyes', + 'Solid Pattern', + 'Solid Pattern Tri', + 'Spots', + 'Spots Fade', + 'Glitter', + 'Candle', + 'Fireworks Starburst', + 'Fireworks 1D', + 'Bouncing Balls', + 'Sinelon', + 'Sinelon Dual', + 'Sinelon Rainbow', + 'Popcorn', + 'Drip', + 'Plasma', + 'Percent', + 'Ripple Rainbow', + 'Heartbeat', + 'Pacifica', + 'Candle Multi', + 'Solid Glitter', + 'Sunrise', + 'Phased', + 'Twinkleup', + 'Noise Pal', + 'Sine', + 'Phased Noise', + 'Flow', + 'Chunchun', + 'Dancing Shadows', + 'Washing Machine', + 'RSVD', + 'Blends', + 'TV Simulator', + 'Dynamic Smooth', + 'Spaceships', + 'Crazy Bees', + 'Ghost Rider', + 'Blobs', + 'Scrolling Text', + 'Drift Rose', + 'Distortion Waves', + 'Soap', + 'Octopus', + 'Waving Cell', + 'Pixels', + 'Pixelwave', + 'Juggles', + 'Matripix', + 'Gravimeter', + 'Plasmoid', + 'Puddles', + 'Midnoise', + 'Noisemeter', + 'Freqwave', + 'Freqmatrix', + 'GEQ', + 'Waterfall', + 'Freqpixels', + 'RSVD', + 'Noisefire', + 'Puddlepeak', + 'Noisemove', + 'Noise2D', + 'Perlin Move', + 'Ripple Peak', + 'Firenoise', + 'Squared Swirl', + 'RSVD', + 'DNA', + 'Matrix', + 'Metaballs', + 'Freqmap', + 'Gravcenter', + 'Gravcentric', + 'Gravfreq', + 'DJ Light', + 'Funky Plank', + 'RSVD', + 'Pulser', + 'Blurz', + 'Drift', + 'Waverly', + 'Sun Radiation', + 'Colored Bursts', + 'Julia', + 'RSVD', + 'RSVD', + 'RSVD', + 'Game Of Life', + 'Tartan', + 'Polar Lights', + 'Swirl', + 'Lissajous', + 'Frizzles', + 'Plasma Ball', + 'Flow Stripe', + 'Hiphotic', + 'Sindots', + 'DNA Spiral', + 'Black Hole', + 'Wavesins', + 'Rocktaves', + 'Akemi', + ]), + 'supported_color_modes': list([ + , + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'light', + 'entity_category': None, + 'entity_id': 'light.wled_websocket', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': None, + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': , + 'translation_key': 'segment', + 'unique_id': 'aabbccddeeff_0', + 'unit_of_measurement': None, + }) +# --- +# name: test_snapshots[rgb_websocket][light.wled_websocket-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'brightness': 128, + 'color_mode': , + 'effect': 'Solid', + 'effect_list': list([ + 'Solid', + 'Blink', + 'Breathe', + 'Wipe', + 'Wipe Random', + 'Random Colors', + 'Sweep', + 'Dynamic', + 'Colorloop', + 'Rainbow', + 'Scan', + 'Scan Dual', + 'Fade', + 'Theater', + 'Theater Rainbow', + 'Running', + 'Saw', + 'Twinkle', + 'Dissolve', + 'Dissolve Rnd', + 'Sparkle', + 'Sparkle Dark', + 'Sparkle+', + 'Strobe', + 'Strobe Rainbow', + 'Strobe Mega', + 'Blink Rainbow', + 'Android', + 'Chase', + 'Chase Random', + 'Chase Rainbow', + 'Chase Flash', + 'Chase Flash Rnd', + 'Rainbow Runner', + 'Colorful', + 'Traffic Light', + 'Sweep Random', + 'Chase 2', + 'Aurora', + 'Stream', + 'Scanner', + 'Lighthouse', + 'Fireworks', + 'Rain', + 'Tetrix', + 'Fire Flicker', + 'Gradient', + 'Loading', + 'Rolling Balls', + 'Fairy', + 'Two Dots', + 'Fairytwinkle', + 'Running Dual', + 'RSVD', + 'Chase 3', + 'Tri Wipe', + 'Tri Fade', + 'Lightning', + 'ICU', + 'Multi Comet', + 'Scanner Dual', + 'Stream 2', + 'Oscillate', + 'Pride 2015', + 'Juggle', + 'Palette', + 'Fire 2012', + 'Colorwaves', + 'Bpm', + 'Fill Noise', + 'Noise 1', + 'Noise 2', + 'Noise 3', + 'Noise 4', + 'Colortwinkles', + 'Lake', + 'Meteor', + 'Meteor Smooth', + 'Railway', + 'Ripple', + 'Twinklefox', + 'Twinklecat', + 'Halloween Eyes', + 'Solid Pattern', + 'Solid Pattern Tri', + 'Spots', + 'Spots Fade', + 'Glitter', + 'Candle', + 'Fireworks Starburst', + 'Fireworks 1D', + 'Bouncing Balls', + 'Sinelon', + 'Sinelon Dual', + 'Sinelon Rainbow', + 'Popcorn', + 'Drip', + 'Plasma', + 'Percent', + 'Ripple Rainbow', + 'Heartbeat', + 'Pacifica', + 'Candle Multi', + 'Solid Glitter', + 'Sunrise', + 'Phased', + 'Twinkleup', + 'Noise Pal', + 'Sine', + 'Phased Noise', + 'Flow', + 'Chunchun', + 'Dancing Shadows', + 'Washing Machine', + 'RSVD', + 'Blends', + 'TV Simulator', + 'Dynamic Smooth', + 'Spaceships', + 'Crazy Bees', + 'Ghost Rider', + 'Blobs', + 'Scrolling Text', + 'Drift Rose', + 'Distortion Waves', + 'Soap', + 'Octopus', + 'Waving Cell', + 'Pixels', + 'Pixelwave', + 'Juggles', + 'Matripix', + 'Gravimeter', + 'Plasmoid', + 'Puddles', + 'Midnoise', + 'Noisemeter', + 'Freqwave', + 'Freqmatrix', + 'GEQ', + 'Waterfall', + 'Freqpixels', + 'RSVD', + 'Noisefire', + 'Puddlepeak', + 'Noisemove', + 'Noise2D', + 'Perlin Move', + 'Ripple Peak', + 'Firenoise', + 'Squared Swirl', + 'RSVD', + 'DNA', + 'Matrix', + 'Metaballs', + 'Freqmap', + 'Gravcenter', + 'Gravcentric', + 'Gravfreq', + 'DJ Light', + 'Funky Plank', + 'RSVD', + 'Pulser', + 'Blurz', + 'Drift', + 'Waverly', + 'Sun Radiation', + 'Colored Bursts', + 'Julia', + 'RSVD', + 'RSVD', + 'RSVD', + 'Game Of Life', + 'Tartan', + 'Polar Lights', + 'Swirl', + 'Lissajous', + 'Frizzles', + 'Plasma Ball', + 'Flow Stripe', + 'Hiphotic', + 'Sindots', + 'DNA Spiral', + 'Black Hole', + 'Wavesins', + 'Rocktaves', + 'Akemi', + ]), + 'friendly_name': 'WLED WebSocket', + 'hs_color': tuple( + 218.906, + 50.196, + ), + 'rgb_color': tuple( + 127, + 172, + 255, + ), + 'supported_color_modes': list([ + , + ]), + 'supported_features': , + 'xy_color': tuple( + 0.208, + 0.217, + ), + }), + 'context': , + 'entity_id': 'light.wled_websocket', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_snapshots[rgbw][light.wled_rgbw_light-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'effect_list': list([ + 'Solid', + 'Blink', + 'Breathe', + 'Wipe', + 'Wipe Random', + 'Random Colors', + 'Sweep', + 'Dynamic', + 'Colorloop', + 'Rainbow', + 'Scan', + 'Scan Dual', + 'Fade', + 'Theater', + 'Theater Rainbow', + 'Running', + 'Saw', + 'Twinkle', + 'Dissolve', + 'Dissolve Rnd', + 'Sparkle', + 'Sparkle Dark', + 'Sparkle+', + 'Strobe', + 'Strobe Rainbow', + 'Strobe Mega', + 'Blink Rainbow', + 'Android', + 'Chase', + 'Chase Random', + 'Chase Rainbow', + 'Chase Flash', + 'Chase Flash Rnd', + 'Rainbow Runner', + 'Colorful', + 'Traffic Light', + 'Sweep Random', + 'Chase 2', + 'Aurora', + 'Stream', + 'Scanner', + 'Lighthouse', + 'Fireworks', + 'Rain', + 'Tetrix', + 'Fire Flicker', + 'Gradient', + 'Loading', + 'Rolling Balls', + 'Fairy', + 'Two Dots', + 'Fairytwinkle', + 'Running Dual', + 'RSVD', + 'Chase 3', + 'Tri Wipe', + 'Tri Fade', + 'Lightning', + 'ICU', + 'Multi Comet', + 'Scanner Dual', + 'Stream 2', + 'Oscillate', + 'Pride 2015', + 'Juggle', + 'Palette', + 'Fire 2012', + 'Colorwaves', + 'Bpm', + 'Fill Noise', + 'Noise 1', + 'Noise 2', + 'Noise 3', + 'Noise 4', + 'Colortwinkles', + 'Lake', + 'Meteor', + 'Meteor Smooth', + 'Railway', + 'Ripple', + 'Twinklefox', + 'Twinklecat', + 'Halloween Eyes', + 'Solid Pattern', + 'Solid Pattern Tri', + 'Spots', + 'Spots Fade', + 'Glitter', + 'Candle', + 'Fireworks Starburst', + 'Fireworks 1D', + 'Bouncing Balls', + 'Sinelon', + 'Sinelon Dual', + 'Sinelon Rainbow', + 'Popcorn', + 'Drip', + 'Plasma', + 'Percent', + 'Ripple Rainbow', + 'Heartbeat', + 'Pacifica', + 'Candle Multi', + 'Solid Glitter', + 'Sunrise', + 'Phased', + 'Twinkleup', + 'Noise Pal', + 'Sine', + 'Phased Noise', + 'Flow', + 'Chunchun', + 'Dancing Shadows', + 'Washing Machine', + 'RSVD', + 'Blends', + 'TV Simulator', + 'Dynamic Smooth', + 'Spaceships', + 'Crazy Bees', + 'Ghost Rider', + 'Blobs', + 'Scrolling Text', + 'Drift Rose', + 'Distortion Waves', + 'Soap', + 'Octopus', + 'Waving Cell', + 'Pixels', + 'Pixelwave', + 'Juggles', + 'Matripix', + 'Gravimeter', + 'Plasmoid', + 'Puddles', + 'Midnoise', + 'Noisemeter', + 'Freqwave', + 'Freqmatrix', + 'GEQ', + 'Waterfall', + 'Freqpixels', + 'RSVD', + 'Noisefire', + 'Puddlepeak', + 'Noisemove', + 'Noise2D', + 'Perlin Move', + 'Ripple Peak', + 'Firenoise', + 'Squared Swirl', + 'RSVD', + 'DNA', + 'Matrix', + 'Metaballs', + 'Freqmap', + 'Gravcenter', + 'Gravcentric', + 'Gravfreq', + 'DJ Light', + 'Funky Plank', + 'RSVD', + 'Pulser', + 'Blurz', + 'Drift', + 'Waverly', + 'Sun Radiation', + 'Colored Bursts', + 'Julia', + 'RSVD', + 'RSVD', + 'RSVD', + 'Game Of Life', + 'Tartan', + 'Polar Lights', + 'Swirl', + 'Lissajous', + 'Frizzles', + 'Plasma Ball', + 'Flow Stripe', + 'Hiphotic', + 'Sindots', + 'DNA Spiral', + 'Black Hole', + 'Wavesins', + 'Rocktaves', + 'Akemi', + ]), + 'supported_color_modes': list([ + , + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'light', + 'entity_category': None, + 'entity_id': 'light.wled_rgbw_light', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': None, + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': , + 'translation_key': 'segment', + 'unique_id': 'aabbccddeeff_0', + 'unit_of_measurement': None, + }) +# --- +# name: test_snapshots[rgbw][light.wled_rgbw_light-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'brightness': 128, + 'color_mode': , + 'effect': 'Solid', + 'effect_list': list([ + 'Solid', + 'Blink', + 'Breathe', + 'Wipe', + 'Wipe Random', + 'Random Colors', + 'Sweep', + 'Dynamic', + 'Colorloop', + 'Rainbow', + 'Scan', + 'Scan Dual', + 'Fade', + 'Theater', + 'Theater Rainbow', + 'Running', + 'Saw', + 'Twinkle', + 'Dissolve', + 'Dissolve Rnd', + 'Sparkle', + 'Sparkle Dark', + 'Sparkle+', + 'Strobe', + 'Strobe Rainbow', + 'Strobe Mega', + 'Blink Rainbow', + 'Android', + 'Chase', + 'Chase Random', + 'Chase Rainbow', + 'Chase Flash', + 'Chase Flash Rnd', + 'Rainbow Runner', + 'Colorful', + 'Traffic Light', + 'Sweep Random', + 'Chase 2', + 'Aurora', + 'Stream', + 'Scanner', + 'Lighthouse', + 'Fireworks', + 'Rain', + 'Tetrix', + 'Fire Flicker', + 'Gradient', + 'Loading', + 'Rolling Balls', + 'Fairy', + 'Two Dots', + 'Fairytwinkle', + 'Running Dual', + 'RSVD', + 'Chase 3', + 'Tri Wipe', + 'Tri Fade', + 'Lightning', + 'ICU', + 'Multi Comet', + 'Scanner Dual', + 'Stream 2', + 'Oscillate', + 'Pride 2015', + 'Juggle', + 'Palette', + 'Fire 2012', + 'Colorwaves', + 'Bpm', + 'Fill Noise', + 'Noise 1', + 'Noise 2', + 'Noise 3', + 'Noise 4', + 'Colortwinkles', + 'Lake', + 'Meteor', + 'Meteor Smooth', + 'Railway', + 'Ripple', + 'Twinklefox', + 'Twinklecat', + 'Halloween Eyes', + 'Solid Pattern', + 'Solid Pattern Tri', + 'Spots', + 'Spots Fade', + 'Glitter', + 'Candle', + 'Fireworks Starburst', + 'Fireworks 1D', + 'Bouncing Balls', + 'Sinelon', + 'Sinelon Dual', + 'Sinelon Rainbow', + 'Popcorn', + 'Drip', + 'Plasma', + 'Percent', + 'Ripple Rainbow', + 'Heartbeat', + 'Pacifica', + 'Candle Multi', + 'Solid Glitter', + 'Sunrise', + 'Phased', + 'Twinkleup', + 'Noise Pal', + 'Sine', + 'Phased Noise', + 'Flow', + 'Chunchun', + 'Dancing Shadows', + 'Washing Machine', + 'RSVD', + 'Blends', + 'TV Simulator', + 'Dynamic Smooth', + 'Spaceships', + 'Crazy Bees', + 'Ghost Rider', + 'Blobs', + 'Scrolling Text', + 'Drift Rose', + 'Distortion Waves', + 'Soap', + 'Octopus', + 'Waving Cell', + 'Pixels', + 'Pixelwave', + 'Juggles', + 'Matripix', + 'Gravimeter', + 'Plasmoid', + 'Puddles', + 'Midnoise', + 'Noisemeter', + 'Freqwave', + 'Freqmatrix', + 'GEQ', + 'Waterfall', + 'Freqpixels', + 'RSVD', + 'Noisefire', + 'Puddlepeak', + 'Noisemove', + 'Noise2D', + 'Perlin Move', + 'Ripple Peak', + 'Firenoise', + 'Squared Swirl', + 'RSVD', + 'DNA', + 'Matrix', + 'Metaballs', + 'Freqmap', + 'Gravcenter', + 'Gravcentric', + 'Gravfreq', + 'DJ Light', + 'Funky Plank', + 'RSVD', + 'Pulser', + 'Blurz', + 'Drift', + 'Waverly', + 'Sun Radiation', + 'Colored Bursts', + 'Julia', + 'RSVD', + 'RSVD', + 'RSVD', + 'Game Of Life', + 'Tartan', + 'Polar Lights', + 'Swirl', + 'Lissajous', + 'Frizzles', + 'Plasma Ball', + 'Flow Stripe', + 'Hiphotic', + 'Sindots', + 'DNA Spiral', + 'Black Hole', + 'Wavesins', + 'Rocktaves', + 'Akemi', + ]), + 'friendly_name': 'WLED RGBW Light', + 'hs_color': tuple( + 0.0, + 64.706, + ), + 'rgb_color': tuple( + 255, + 90, + 90, + ), + 'rgbw_color': tuple( + 255, + 0, + 0, + 139, + ), + 'supported_color_modes': list([ + , + ]), + 'supported_features': , + 'xy_color': tuple( + 0.6, + 0.307, + ), + }), + 'context': , + 'entity_id': 'light.wled_rgbw_light', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- diff --git a/tests/components/wled/snapshots/test_number.ambr b/tests/components/wled/snapshots/test_number.ambr index 8f94c2709849a9..e958ba65be4f55 100644 --- a/tests/components/wled/snapshots/test_number.ambr +++ b/tests/components/wled/snapshots/test_number.ambr @@ -183,3 +183,231 @@ 'via_device_id': None, }) # --- +# name: test_snapshots[number.wled_rgb_light_intensity-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'max': 255, + 'min': 0, + 'mode': , + 'step': 1, + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'number', + 'entity_category': , + 'entity_id': 'number.wled_rgb_light_intensity', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Intensity', + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'intensity', + 'unique_id': 'aabbccddeeff_intensity_0', + 'unit_of_measurement': None, + }) +# --- +# name: test_snapshots[number.wled_rgb_light_intensity-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'WLED RGB Light Intensity', + 'max': 255, + 'min': 0, + 'mode': , + 'step': 1, + }), + 'context': , + 'entity_id': 'number.wled_rgb_light_intensity', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '128', + }) +# --- +# name: test_snapshots[number.wled_rgb_light_segment_1_intensity-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'max': 255, + 'min': 0, + 'mode': , + 'step': 1, + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'number', + 'entity_category': , + 'entity_id': 'number.wled_rgb_light_segment_1_intensity', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Segment 1 intensity', + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'segment_intensity', + 'unique_id': 'aabbccddeeff_intensity_1', + 'unit_of_measurement': None, + }) +# --- +# name: test_snapshots[number.wled_rgb_light_segment_1_intensity-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'WLED RGB Light Segment 1 intensity', + 'max': 255, + 'min': 0, + 'mode': , + 'step': 1, + }), + 'context': , + 'entity_id': 'number.wled_rgb_light_segment_1_intensity', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '64', + }) +# --- +# name: test_snapshots[number.wled_rgb_light_segment_1_speed-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'max': 255, + 'min': 0, + 'mode': , + 'step': 1, + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'number', + 'entity_category': , + 'entity_id': 'number.wled_rgb_light_segment_1_speed', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Segment 1 speed', + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'segment_speed', + 'unique_id': 'aabbccddeeff_speed_1', + 'unit_of_measurement': None, + }) +# --- +# name: test_snapshots[number.wled_rgb_light_segment_1_speed-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'WLED RGB Light Segment 1 speed', + 'max': 255, + 'min': 0, + 'mode': , + 'step': 1, + }), + 'context': , + 'entity_id': 'number.wled_rgb_light_segment_1_speed', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '16', + }) +# --- +# name: test_snapshots[number.wled_rgb_light_speed-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'max': 255, + 'min': 0, + 'mode': , + 'step': 1, + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'number', + 'entity_category': , + 'entity_id': 'number.wled_rgb_light_speed', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Speed', + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'speed', + 'unique_id': 'aabbccddeeff_speed_0', + 'unit_of_measurement': None, + }) +# --- +# name: test_snapshots[number.wled_rgb_light_speed-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'WLED RGB Light Speed', + 'max': 255, + 'min': 0, + 'mode': , + 'step': 1, + }), + 'context': , + 'entity_id': 'number.wled_rgb_light_speed', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '32', + }) +# --- diff --git a/tests/components/wled/snapshots/test_select.ambr b/tests/components/wled/snapshots/test_select.ambr index a981b74185240c..7287cbf411db7c 100644 --- a/tests/components/wled/snapshots/test_select.ambr +++ b/tests/components/wled/snapshots/test_select.ambr @@ -1,102 +1,10 @@ # serializer version: 1 -# name: test_color_palette_state[rgb-select.wled_rgb_light_live_override-2-live-called_with1] - StateSnapshot({ - 'attributes': ReadOnlyDict({ - 'friendly_name': 'WLED RGB Light Live override', - 'options': list([ - '0', - '1', - '2', - ]), - }), - 'context': , - 'entity_id': 'select.wled_rgb_light_live_override', - 'last_changed': , - 'last_reported': , - 'last_updated': , - 'state': '0', - }) -# --- -# name: test_color_palette_state[rgb-select.wled_rgb_light_live_override-2-live-called_with1].1 +# name: test_snapshots[select.wled_rgb_light_color_palette-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), 'area_id': None, 'capabilities': dict({ - 'options': list([ - '0', - '1', - '2', - ]), - }), - 'config_entry_id': , - 'config_subentry_id': , - 'device_class': None, - 'device_id': , - 'disabled_by': None, - 'domain': 'select', - 'entity_category': , - 'entity_id': 'select.wled_rgb_light_live_override', - 'has_entity_name': True, - 'hidden_by': None, - 'icon': None, - 'id': , - 'labels': set({ - }), - 'name': None, - 'options': dict({ - }), - 'original_device_class': None, - 'original_icon': None, - 'original_name': 'Live override', - 'platform': 'wled', - 'previous_unique_id': None, - 'suggested_object_id': None, - 'supported_features': 0, - 'translation_key': 'live_override', - 'unique_id': 'aabbccddeeff_live_override', - 'unit_of_measurement': None, - }) -# --- -# name: test_color_palette_state[rgb-select.wled_rgb_light_live_override-2-live-called_with1].2 - DeviceRegistryEntrySnapshot({ - 'area_id': None, - 'config_entries': , - 'config_entries_subentries': , - 'configuration_url': 'http://127.0.0.1', - 'connections': set({ - tuple( - 'mac', - 'aa:bb:cc:dd:ee:ff', - ), - }), - 'disabled_by': None, - 'entry_type': None, - 'hw_version': 'esp32', - 'id': , - 'identifiers': set({ - tuple( - 'wled', - 'aabbccddeeff', - ), - }), - 'labels': set({ - }), - 'manufacturer': 'WLED', - 'model': 'FOSS', - 'model_id': None, - 'name': 'WLED RGB Light', - 'name_by_user': None, - 'primary_config_entry': , - 'serial_number': None, - 'sw_version': '0.14.4', - 'via_device_id': None, - }) -# --- -# name: test_color_palette_state[rgb-select.wled_rgb_light_segment_1_color_palette-Icefire-segment-called_with0] - StateSnapshot({ - 'attributes': ReadOnlyDict({ - 'friendly_name': 'WLED RGB Light Segment 1 color palette', 'options': list([ '* Color 1', '* Color Gradient', @@ -171,20 +79,39 @@ 'Yelmag', ]), }), - 'context': , - 'entity_id': 'select.wled_rgb_light_segment_1_color_palette', - 'last_changed': , - 'last_reported': , - 'last_updated': , - 'state': '* Random Cycle', + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'select', + 'entity_category': , + 'entity_id': 'select.wled_rgb_light_color_palette', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Color palette', + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'color_palette', + 'unique_id': 'aabbccddeeff_palette_0', + 'unit_of_measurement': None, }) # --- -# name: test_color_palette_state[rgb-select.wled_rgb_light_segment_1_color_palette-Icefire-segment-called_with0].1 - EntityRegistryEntrySnapshot({ - 'aliases': set({ - }), - 'area_id': None, - 'capabilities': dict({ +# name: test_snapshots[select.wled_rgb_light_color_palette-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'WLED RGB Light Color palette', 'options': list([ '* Color 1', '* Color Gradient', @@ -259,6 +186,26 @@ 'Yelmag', ]), }), + 'context': , + 'entity_id': 'select.wled_rgb_light_color_palette', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'Default', + }) +# --- +# name: test_snapshots[select.wled_rgb_light_live_override-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'options': list([ + '0', + '1', + '2', + ]), + }), 'config_entry_id': , 'config_subentry_id': , 'device_class': None, @@ -266,7 +213,7 @@ 'disabled_by': None, 'domain': 'select', 'entity_category': , - 'entity_id': 'select.wled_rgb_light_segment_1_color_palette', + 'entity_id': 'select.wled_rgb_light_live_override', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -278,77 +225,41 @@ }), 'original_device_class': None, 'original_icon': None, - 'original_name': 'Segment 1 color palette', + 'original_name': 'Live override', 'platform': 'wled', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': 'segment_color_palette', - 'unique_id': 'aabbccddeeff_palette_1', + 'translation_key': 'live_override', + 'unique_id': 'aabbccddeeff_live_override', 'unit_of_measurement': None, }) # --- -# name: test_color_palette_state[rgb-select.wled_rgb_light_segment_1_color_palette-Icefire-segment-called_with0].2 - DeviceRegistryEntrySnapshot({ - 'area_id': None, - 'config_entries': , - 'config_entries_subentries': , - 'configuration_url': 'http://127.0.0.1', - 'connections': set({ - tuple( - 'mac', - 'aa:bb:cc:dd:ee:ff', - ), - }), - 'disabled_by': None, - 'entry_type': None, - 'hw_version': 'esp32', - 'id': , - 'identifiers': set({ - tuple( - 'wled', - 'aabbccddeeff', - ), - }), - 'labels': set({ - }), - 'manufacturer': 'WLED', - 'model': 'FOSS', - 'model_id': None, - 'name': 'WLED RGB Light', - 'name_by_user': None, - 'primary_config_entry': , - 'serial_number': None, - 'sw_version': '0.14.4', - 'via_device_id': None, - }) -# --- -# name: test_color_palette_state[rgbw-select.wled_rgbw_light_playlist-Playlist 2-playlist-called_with2] +# name: test_snapshots[select.wled_rgb_light_live_override-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'WLED RGBW Light Playlist', + 'friendly_name': 'WLED RGB Light Live override', 'options': list([ - 'Playlist 1', - 'Playlist 2', + '0', + '1', + '2', ]), }), 'context': , - 'entity_id': 'select.wled_rgbw_light_playlist', + 'entity_id': 'select.wled_rgb_light_live_override', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': 'unknown', + 'state': '0', }) # --- -# name: test_color_palette_state[rgbw-select.wled_rgbw_light_playlist-Playlist 2-playlist-called_with2].1 +# name: test_snapshots[select.wled_rgb_light_playlist-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), 'area_id': None, 'capabilities': dict({ 'options': list([ - 'Playlist 1', - 'Playlist 2', ]), }), 'config_entry_id': , @@ -358,7 +269,7 @@ 'disabled_by': None, 'domain': 'select', 'entity_category': None, - 'entity_id': 'select.wled_rgbw_light_playlist', + 'entity_id': 'select.wled_rgb_light_playlist', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -380,67 +291,28 @@ 'unit_of_measurement': None, }) # --- -# name: test_color_palette_state[rgbw-select.wled_rgbw_light_playlist-Playlist 2-playlist-called_with2].2 - DeviceRegistryEntrySnapshot({ - 'area_id': None, - 'config_entries': , - 'config_entries_subentries': , - 'configuration_url': 'http://127.0.0.1', - 'connections': set({ - tuple( - 'mac', - 'aa:bb:cc:dd:ee:ff', - ), - }), - 'disabled_by': None, - 'entry_type': None, - 'hw_version': 'esp32', - 'id': , - 'identifiers': set({ - tuple( - 'wled', - 'aabbccddeeff', - ), - }), - 'labels': set({ - }), - 'manufacturer': 'WLED', - 'model': 'FOSS', - 'model_id': None, - 'name': 'WLED RGBW Light', - 'name_by_user': None, - 'primary_config_entry': , - 'serial_number': None, - 'sw_version': '0.99.0b1', - 'via_device_id': None, - }) -# --- -# name: test_color_palette_state[rgbw-select.wled_rgbw_light_preset-Preset 2-preset-called_with3] +# name: test_snapshots[select.wled_rgb_light_playlist-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'WLED RGBW Light Preset', + 'friendly_name': 'WLED RGB Light Playlist', 'options': list([ - 'Preset 1', - 'Preset 2', ]), }), 'context': , - 'entity_id': 'select.wled_rgbw_light_preset', + 'entity_id': 'select.wled_rgb_light_playlist', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': 'unknown', + 'state': 'unavailable', }) # --- -# name: test_color_palette_state[rgbw-select.wled_rgbw_light_preset-Preset 2-preset-called_with3].1 +# name: test_snapshots[select.wled_rgb_light_preset-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), 'area_id': None, 'capabilities': dict({ 'options': list([ - 'Preset 1', - 'Preset 2', ]), }), 'config_entry_id': , @@ -450,7 +322,7 @@ 'disabled_by': None, 'domain': 'select', 'entity_category': None, - 'entity_id': 'select.wled_rgbw_light_preset', + 'entity_id': 'select.wled_rgb_light_preset', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -472,38 +344,213 @@ 'unit_of_measurement': None, }) # --- -# name: test_color_palette_state[rgbw-select.wled_rgbw_light_preset-Preset 2-preset-called_with3].2 - DeviceRegistryEntrySnapshot({ +# name: test_snapshots[select.wled_rgb_light_preset-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'WLED RGB Light Preset', + 'options': list([ + ]), + }), + 'context': , + 'entity_id': 'select.wled_rgb_light_preset', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_snapshots[select.wled_rgb_light_segment_1_color_palette-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), 'area_id': None, - 'config_entries': , - 'config_entries_subentries': , - 'configuration_url': 'http://127.0.0.1', - 'connections': set({ - tuple( - 'mac', - 'aa:bb:cc:dd:ee:ff', - ), + 'capabilities': dict({ + 'options': list([ + '* Color 1', + '* Color Gradient', + '* Colors 1&2', + '* Colors Only', + '* Random Cycle', + 'Analogous', + 'April Night', + 'Aqua Flash', + 'Atlantica', + 'Aurora', + 'Aurora 2', + 'Autumn', + 'Beach', + 'Beech', + 'Blink Red', + 'Breeze', + 'C9', + 'C9 2', + 'C9 New', + 'Candy', + 'Candy2', + 'Cloud', + 'Cyane', + 'Default', + 'Departure', + 'Drywet', + 'Fairy Reaf', + 'Fire', + 'Forest', + 'Grintage', + 'Hult', + 'Hult 64', + 'Icefire', + 'Jul', + 'Landscape', + 'Lava', + 'Light Pink', + 'Lite Light', + 'Magenta', + 'Magred', + 'Ocean', + 'Orange & Teal', + 'Orangery', + 'Party', + 'Pastel', + 'Pink Candy', + 'Rainbow', + 'Rainbow Bands', + 'Red & Blue', + 'Red Flash', + 'Red Reaf', + 'Red Shift', + 'Red Tide', + 'Retro Clown', + 'Rewhi', + 'Rivendell', + 'Sakura', + 'Semi Blue', + 'Sherbet', + 'Splash', + 'Sunset', + 'Sunset 2', + 'Temperature', + 'Tertiary', + 'Tiamat', + 'Toxy Reaf', + 'Vintage', + 'Yelblu', + 'Yelblu Hot', + 'Yellowout', + 'Yelmag', + ]), }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , 'disabled_by': None, - 'entry_type': None, - 'hw_version': 'esp32', + 'domain': 'select', + 'entity_category': , + 'entity_id': 'select.wled_rgb_light_segment_1_color_palette', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, 'id': , - 'identifiers': set({ - tuple( - 'wled', - 'aabbccddeeff', - ), - }), 'labels': set({ }), - 'manufacturer': 'WLED', - 'model': 'FOSS', - 'model_id': None, - 'name': 'WLED RGBW Light', - 'name_by_user': None, - 'primary_config_entry': , - 'serial_number': None, - 'sw_version': '0.99.0b1', - 'via_device_id': None, + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Segment 1 color palette', + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'segment_color_palette', + 'unique_id': 'aabbccddeeff_palette_1', + 'unit_of_measurement': None, + }) +# --- +# name: test_snapshots[select.wled_rgb_light_segment_1_color_palette-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'WLED RGB Light Segment 1 color palette', + 'options': list([ + '* Color 1', + '* Color Gradient', + '* Colors 1&2', + '* Colors Only', + '* Random Cycle', + 'Analogous', + 'April Night', + 'Aqua Flash', + 'Atlantica', + 'Aurora', + 'Aurora 2', + 'Autumn', + 'Beach', + 'Beech', + 'Blink Red', + 'Breeze', + 'C9', + 'C9 2', + 'C9 New', + 'Candy', + 'Candy2', + 'Cloud', + 'Cyane', + 'Default', + 'Departure', + 'Drywet', + 'Fairy Reaf', + 'Fire', + 'Forest', + 'Grintage', + 'Hult', + 'Hult 64', + 'Icefire', + 'Jul', + 'Landscape', + 'Lava', + 'Light Pink', + 'Lite Light', + 'Magenta', + 'Magred', + 'Ocean', + 'Orange & Teal', + 'Orangery', + 'Party', + 'Pastel', + 'Pink Candy', + 'Rainbow', + 'Rainbow Bands', + 'Red & Blue', + 'Red Flash', + 'Red Reaf', + 'Red Shift', + 'Red Tide', + 'Retro Clown', + 'Rewhi', + 'Rivendell', + 'Sakura', + 'Semi Blue', + 'Sherbet', + 'Splash', + 'Sunset', + 'Sunset 2', + 'Temperature', + 'Tertiary', + 'Tiamat', + 'Toxy Reaf', + 'Vintage', + 'Yelblu', + 'Yelblu Hot', + 'Yellowout', + 'Yelmag', + ]), + }), + 'context': , + 'entity_id': 'select.wled_rgb_light_segment_1_color_palette', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '* Random Cycle', }) # --- diff --git a/tests/components/wled/snapshots/test_sensor.ambr b/tests/components/wled/snapshots/test_sensor.ambr new file mode 100644 index 00000000000000..c20e84d5b01b1f --- /dev/null +++ b/tests/components/wled/snapshots/test_sensor.ambr @@ -0,0 +1,512 @@ +# serializer version: 1 +# name: test_snapshots[sensor.wled_rgb_light_estimated_current-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.wled_rgb_light_estimated_current', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 0, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Estimated current', + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'estimated_current', + 'unique_id': 'aabbccddeeff_estimated_current', + 'unit_of_measurement': , + }) +# --- +# name: test_snapshots[sensor.wled_rgb_light_estimated_current-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'current', + 'friendly_name': 'WLED RGB Light Estimated current', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.wled_rgb_light_estimated_current', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '515', + }) +# --- +# name: test_snapshots[sensor.wled_rgb_light_free_memory-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.wled_rgb_light_free_memory', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 0, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Free memory', + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'free_heap', + 'unique_id': 'aabbccddeeff_free_heap', + 'unit_of_measurement': , + }) +# --- +# name: test_snapshots[sensor.wled_rgb_light_free_memory-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'data_size', + 'friendly_name': 'WLED RGB Light Free memory', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.wled_rgb_light_free_memory', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '198384', + }) +# --- +# name: test_snapshots[sensor.wled_rgb_light_ip-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.wled_rgb_light_ip', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'IP', + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'ip', + 'unique_id': 'aabbccddeeff_ip', + 'unit_of_measurement': None, + }) +# --- +# name: test_snapshots[sensor.wled_rgb_light_ip-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'WLED RGB Light IP', + }), + 'context': , + 'entity_id': 'sensor.wled_rgb_light_ip', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '127.0.0.1', + }) +# --- +# name: test_snapshots[sensor.wled_rgb_light_led_count-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.wled_rgb_light_led_count', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'LED count', + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'info_leds_count', + 'unique_id': 'aabbccddeeff_info_leds_count', + 'unit_of_measurement': None, + }) +# --- +# name: test_snapshots[sensor.wled_rgb_light_led_count-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'WLED RGB Light LED count', + }), + 'context': , + 'entity_id': 'sensor.wled_rgb_light_led_count', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '30', + }) +# --- +# name: test_snapshots[sensor.wled_rgb_light_max_current-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.wled_rgb_light_max_current', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 0, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Max current', + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'info_leds_max_power', + 'unique_id': 'aabbccddeeff_info_leds_max_power', + 'unit_of_measurement': , + }) +# --- +# name: test_snapshots[sensor.wled_rgb_light_max_current-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'current', + 'friendly_name': 'WLED RGB Light Max current', + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.wled_rgb_light_max_current', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '850', + }) +# --- +# name: test_snapshots[sensor.wled_rgb_light_uptime-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.wled_rgb_light_uptime', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Uptime', + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'uptime', + 'unique_id': 'aabbccddeeff_uptime', + 'unit_of_measurement': None, + }) +# --- +# name: test_snapshots[sensor.wled_rgb_light_uptime-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'timestamp', + 'friendly_name': 'WLED RGB Light Uptime', + }), + 'context': , + 'entity_id': 'sensor.wled_rgb_light_uptime', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '2021-11-04T16:20:53+00:00', + }) +# --- +# name: test_snapshots[sensor.wled_rgb_light_wi_fi_bssid-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.wled_rgb_light_wi_fi_bssid', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Wi-Fi BSSID', + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'wifi_bssid', + 'unique_id': 'aabbccddeeff_wifi_bssid', + 'unit_of_measurement': None, + }) +# --- +# name: test_snapshots[sensor.wled_rgb_light_wi_fi_bssid-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'WLED RGB Light Wi-Fi BSSID', + }), + 'context': , + 'entity_id': 'sensor.wled_rgb_light_wi_fi_bssid', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'AA:AA:AA:AA:AA:BB', + }) +# --- +# name: test_snapshots[sensor.wled_rgb_light_wi_fi_channel-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.wled_rgb_light_wi_fi_channel', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Wi-Fi channel', + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'wifi_channel', + 'unique_id': 'aabbccddeeff_wifi_channel', + 'unit_of_measurement': None, + }) +# --- +# name: test_snapshots[sensor.wled_rgb_light_wi_fi_channel-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'WLED RGB Light Wi-Fi channel', + }), + 'context': , + 'entity_id': 'sensor.wled_rgb_light_wi_fi_channel', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '11', + }) +# --- +# name: test_snapshots[sensor.wled_rgb_light_wi_fi_rssi-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.wled_rgb_light_wi_fi_rssi', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Wi-Fi RSSI', + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'wifi_rssi', + 'unique_id': 'aabbccddeeff_wifi_rssi', + 'unit_of_measurement': 'dBm', + }) +# --- +# name: test_snapshots[sensor.wled_rgb_light_wi_fi_rssi-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'signal_strength', + 'friendly_name': 'WLED RGB Light Wi-Fi RSSI', + 'state_class': , + 'unit_of_measurement': 'dBm', + }), + 'context': , + 'entity_id': 'sensor.wled_rgb_light_wi_fi_rssi', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '-43', + }) +# --- +# name: test_snapshots[sensor.wled_rgb_light_wi_fi_signal-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.wled_rgb_light_wi_fi_signal', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Wi-Fi signal', + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'wifi_signal', + 'unique_id': 'aabbccddeeff_wifi_signal', + 'unit_of_measurement': '%', + }) +# --- +# name: test_snapshots[sensor.wled_rgb_light_wi_fi_signal-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'WLED RGB Light Wi-Fi signal', + 'state_class': , + 'unit_of_measurement': '%', + }), + 'context': , + 'entity_id': 'sensor.wled_rgb_light_wi_fi_signal', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '100', + }) +# --- diff --git a/tests/components/wled/snapshots/test_switch.ambr b/tests/components/wled/snapshots/test_switch.ambr index 43e91f7b4852db..422728be5d2059 100644 --- a/tests/components/wled/snapshots/test_switch.ambr +++ b/tests/components/wled/snapshots/test_switch.ambr @@ -1,5 +1,40 @@ # serializer version: 1 -# name: test_switch_state[switch.wled_rgb_light_nightlight-nightlight-called_with_on0-called_with_off0] +# name: test_snapshots[rgb][switch.wled_rgb_light_nightlight-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.wled_rgb_light_nightlight', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Nightlight', + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'nightlight', + 'unique_id': 'aabbccddeeff_nightlight', + 'unit_of_measurement': None, + }) +# --- +# name: test_snapshots[rgb][switch.wled_rgb_light_nightlight-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'duration': 60, @@ -14,7 +49,7 @@ 'state': 'off', }) # --- -# name: test_switch_state[switch.wled_rgb_light_nightlight-nightlight-called_with_on0-called_with_off0].1 +# name: test_snapshots[rgb][switch.wled_rgb_light_reverse-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -27,7 +62,7 @@ 'disabled_by': None, 'domain': 'switch', 'entity_category': , - 'entity_id': 'switch.wled_rgb_light_nightlight', + 'entity_id': 'switch.wled_rgb_light_reverse', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -39,52 +74,17 @@ }), 'original_device_class': None, 'original_icon': None, - 'original_name': 'Nightlight', + 'original_name': 'Reverse', 'platform': 'wled', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': 'nightlight', - 'unique_id': 'aabbccddeeff_nightlight', + 'translation_key': 'reverse', + 'unique_id': 'aabbccddeeff_reverse_0', 'unit_of_measurement': None, }) # --- -# name: test_switch_state[switch.wled_rgb_light_nightlight-nightlight-called_with_on0-called_with_off0].2 - DeviceRegistryEntrySnapshot({ - 'area_id': None, - 'config_entries': , - 'config_entries_subentries': , - 'configuration_url': 'http://127.0.0.1', - 'connections': set({ - tuple( - 'mac', - 'aa:bb:cc:dd:ee:ff', - ), - }), - 'disabled_by': None, - 'entry_type': None, - 'hw_version': 'esp32', - 'id': , - 'identifiers': set({ - tuple( - 'wled', - 'aabbccddeeff', - ), - }), - 'labels': set({ - }), - 'manufacturer': 'WLED', - 'model': 'FOSS', - 'model_id': None, - 'name': 'WLED RGB Light', - 'name_by_user': None, - 'primary_config_entry': , - 'serial_number': None, - 'sw_version': '0.14.4', - 'via_device_id': None, - }) -# --- -# name: test_switch_state[switch.wled_rgb_light_reverse-segment-called_with_on1-called_with_off1] +# name: test_snapshots[rgb][switch.wled_rgb_light_reverse-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'friendly_name': 'WLED RGB Light Reverse', @@ -97,7 +97,7 @@ 'state': 'off', }) # --- -# name: test_switch_state[switch.wled_rgb_light_reverse-segment-called_with_on1-called_with_off1].1 +# name: test_snapshots[rgb][switch.wled_rgb_light_segment_1_reverse-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -110,7 +110,7 @@ 'disabled_by': None, 'domain': 'switch', 'entity_category': , - 'entity_id': 'switch.wled_rgb_light_reverse', + 'entity_id': 'switch.wled_rgb_light_segment_1_reverse', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -122,52 +122,65 @@ }), 'original_device_class': None, 'original_icon': None, - 'original_name': 'Reverse', + 'original_name': 'Segment 1 reverse', 'platform': 'wled', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': 'reverse', - 'unique_id': 'aabbccddeeff_reverse_0', + 'translation_key': 'segment_reverse', + 'unique_id': 'aabbccddeeff_reverse_1', 'unit_of_measurement': None, }) # --- -# name: test_switch_state[switch.wled_rgb_light_reverse-segment-called_with_on1-called_with_off1].2 - DeviceRegistryEntrySnapshot({ - 'area_id': None, - 'config_entries': , - 'config_entries_subentries': , - 'configuration_url': 'http://127.0.0.1', - 'connections': set({ - tuple( - 'mac', - 'aa:bb:cc:dd:ee:ff', - ), +# name: test_snapshots[rgb][switch.wled_rgb_light_segment_1_reverse-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'WLED RGB Light Segment 1 reverse', + }), + 'context': , + 'entity_id': 'switch.wled_rgb_light_segment_1_reverse', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_snapshots[rgb][switch.wled_rgb_light_sync_receive-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , 'disabled_by': None, - 'entry_type': None, - 'hw_version': 'esp32', + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.wled_rgb_light_sync_receive', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, 'id': , - 'identifiers': set({ - tuple( - 'wled', - 'aabbccddeeff', - ), - }), 'labels': set({ }), - 'manufacturer': 'WLED', - 'model': 'FOSS', - 'model_id': None, - 'name': 'WLED RGB Light', - 'name_by_user': None, - 'primary_config_entry': , - 'serial_number': None, - 'sw_version': '0.14.4', - 'via_device_id': None, + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Sync receive', + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'sync_receive', + 'unique_id': 'aabbccddeeff_sync_receive', + 'unit_of_measurement': None, }) # --- -# name: test_switch_state[switch.wled_rgb_light_sync_receive-sync-called_with_on2-called_with_off2] +# name: test_snapshots[rgb][switch.wled_rgb_light_sync_receive-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'friendly_name': 'WLED RGB Light Sync receive', @@ -181,7 +194,7 @@ 'state': 'on', }) # --- -# name: test_switch_state[switch.wled_rgb_light_sync_receive-sync-called_with_on2-called_with_off2].1 +# name: test_snapshots[rgb][switch.wled_rgb_light_sync_send-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -194,7 +207,7 @@ 'disabled_by': None, 'domain': 'switch', 'entity_category': , - 'entity_id': 'switch.wled_rgb_light_sync_receive', + 'entity_id': 'switch.wled_rgb_light_sync_send', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -206,66 +219,178 @@ }), 'original_device_class': None, 'original_icon': None, - 'original_name': 'Sync receive', + 'original_name': 'Sync send', 'platform': 'wled', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': 'sync_receive', - 'unique_id': 'aabbccddeeff_sync_receive', + 'translation_key': 'sync_send', + 'unique_id': 'aabbccddeeff_sync_send', 'unit_of_measurement': None, }) # --- -# name: test_switch_state[switch.wled_rgb_light_sync_receive-sync-called_with_on2-called_with_off2].2 - DeviceRegistryEntrySnapshot({ +# name: test_snapshots[rgb][switch.wled_rgb_light_sync_send-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'WLED RGB Light Sync send', + 'udp_port': 21324, + }), + 'context': , + 'entity_id': 'switch.wled_rgb_light_sync_send', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_snapshots[rgb_single_segment][switch.wled_rgb_light_nightlight-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), 'area_id': None, - 'config_entries': , - 'config_entries_subentries': , - 'configuration_url': 'http://127.0.0.1', - 'connections': set({ - tuple( - 'mac', - 'aa:bb:cc:dd:ee:ff', - ), + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.wled_rgb_light_nightlight', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Nightlight', + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'nightlight', + 'unique_id': 'aabbccddeeff_nightlight', + 'unit_of_measurement': None, + }) +# --- +# name: test_snapshots[rgb_single_segment][switch.wled_rgb_light_nightlight-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'duration': 60, + 'friendly_name': 'WLED RGB Light Nightlight', + 'target_brightness': 0, + }), + 'context': , + 'entity_id': 'switch.wled_rgb_light_nightlight', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_snapshots[rgb_single_segment][switch.wled_rgb_light_reverse-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , 'disabled_by': None, - 'entry_type': None, - 'hw_version': 'esp32', + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.wled_rgb_light_reverse', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, 'id': , - 'identifiers': set({ - tuple( - 'wled', - 'aabbccddeeff', - ), + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Reverse', + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'reverse', + 'unique_id': 'aabbccddeeff_reverse_0', + 'unit_of_measurement': None, + }) +# --- +# name: test_snapshots[rgb_single_segment][switch.wled_rgb_light_reverse-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'WLED RGB Light Reverse', + }), + 'context': , + 'entity_id': 'switch.wled_rgb_light_reverse', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_snapshots[rgb_single_segment][switch.wled_rgb_light_sync_receive-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.wled_rgb_light_sync_receive', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , 'labels': set({ }), - 'manufacturer': 'WLED', - 'model': 'FOSS', - 'model_id': None, - 'name': 'WLED RGB Light', - 'name_by_user': None, - 'primary_config_entry': , - 'serial_number': None, - 'sw_version': '0.14.4', - 'via_device_id': None, + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Sync receive', + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'sync_receive', + 'unique_id': 'aabbccddeeff_sync_receive', + 'unit_of_measurement': None, }) # --- -# name: test_switch_state[switch.wled_rgb_light_sync_send-sync-called_with_on3-called_with_off3] +# name: test_snapshots[rgb_single_segment][switch.wled_rgb_light_sync_receive-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'WLED RGB Light Sync send', + 'friendly_name': 'WLED RGB Light Sync receive', 'udp_port': 21324, }), 'context': , - 'entity_id': 'switch.wled_rgb_light_sync_send', + 'entity_id': 'switch.wled_rgb_light_sync_receive', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': 'off', + 'state': 'on', }) # --- -# name: test_switch_state[switch.wled_rgb_light_sync_send-sync-called_with_on3-called_with_off3].1 +# name: test_snapshots[rgb_single_segment][switch.wled_rgb_light_sync_send-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -300,38 +425,17 @@ 'unit_of_measurement': None, }) # --- -# name: test_switch_state[switch.wled_rgb_light_sync_send-sync-called_with_on3-called_with_off3].2 - DeviceRegistryEntrySnapshot({ - 'area_id': None, - 'config_entries': , - 'config_entries_subentries': , - 'configuration_url': 'http://127.0.0.1', - 'connections': set({ - tuple( - 'mac', - 'aa:bb:cc:dd:ee:ff', - ), - }), - 'disabled_by': None, - 'entry_type': None, - 'hw_version': 'esp32', - 'id': , - 'identifiers': set({ - tuple( - 'wled', - 'aabbccddeeff', - ), - }), - 'labels': set({ +# name: test_snapshots[rgb_single_segment][switch.wled_rgb_light_sync_send-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'WLED RGB Light Sync send', + 'udp_port': 21324, }), - 'manufacturer': 'WLED', - 'model': 'FOSS', - 'model_id': None, - 'name': 'WLED RGB Light', - 'name_by_user': None, - 'primary_config_entry': , - 'serial_number': None, - 'sw_version': '0.14.4', - 'via_device_id': None, + 'context': , + 'entity_id': 'switch.wled_rgb_light_sync_send', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', }) # --- diff --git a/tests/components/wled/snapshots/test_update.ambr b/tests/components/wled/snapshots/test_update.ambr new file mode 100644 index 00000000000000..2a61674219c722 --- /dev/null +++ b/tests/components/wled/snapshots/test_update.ambr @@ -0,0 +1,140 @@ +# serializer version: 1 +# name: test_no_update_available[rgb_websocket] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'auto_update': False, + 'device_class': 'firmware', + 'display_precision': 0, + 'entity_picture': 'https://brands.home-assistant.io/_/wled/icon.png', + 'friendly_name': 'WLED WebSocket Firmware', + 'in_progress': False, + 'installed_version': '0.99.0', + 'latest_version': '0.99.0', + 'release_summary': None, + 'release_url': 'https://github.com/wled/WLED/releases/tag/v0.99.0', + 'skipped_version': None, + 'supported_features': , + 'title': 'WLED', + 'update_percentage': None, + }), + 'context': , + 'entity_id': 'update.wled_websocket_firmware', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_update_available.2 + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'auto_update': False, + 'device_class': 'firmware', + 'display_precision': 0, + 'entity_picture': 'https://brands.home-assistant.io/_/wled/icon.png', + 'friendly_name': 'WLED RGB Light Firmware', + 'in_progress': False, + 'installed_version': '0.14.4', + 'latest_version': '0.99.0', + 'release_summary': None, + 'release_url': 'https://github.com/wled/WLED/releases/tag/v0.99.0', + 'skipped_version': None, + 'supported_features': , + 'title': 'WLED', + 'update_percentage': None, + }), + 'context': , + 'entity_id': 'update.wled_rgb_light_firmware', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_update_available[update.wled_rgb_light_firmware-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'update', + 'entity_category': , + 'entity_id': 'update.wled_rgb_light_firmware', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Firmware', + 'platform': 'wled', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': , + 'translation_key': None, + 'unique_id': 'aabbccddeeff', + 'unit_of_measurement': None, + }) +# --- +# name: test_update_available[update.wled_rgb_light_firmware-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'auto_update': False, + 'device_class': 'firmware', + 'display_precision': 0, + 'entity_picture': 'https://brands.home-assistant.io/_/wled/icon.png', + 'friendly_name': 'WLED RGB Light Firmware', + 'in_progress': False, + 'installed_version': '0.14.4', + 'latest_version': '0.99.0', + 'release_summary': None, + 'release_url': 'https://github.com/wled/WLED/releases/tag/v0.99.0', + 'skipped_version': None, + 'supported_features': , + 'title': 'WLED', + 'update_percentage': None, + }), + 'context': , + 'entity_id': 'update.wled_rgb_light_firmware', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_update_information_available + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'auto_update': False, + 'device_class': 'firmware', + 'display_precision': 0, + 'entity_picture': 'https://brands.home-assistant.io/_/wled/icon.png', + 'friendly_name': 'WLED RGB Light Firmware', + 'in_progress': False, + 'installed_version': '0.14.4', + 'latest_version': None, + 'release_summary': None, + 'release_url': None, + 'skipped_version': None, + 'supported_features': , + 'title': 'WLED', + 'update_percentage': None, + }), + 'context': , + 'entity_id': 'update.wled_rgb_light_firmware', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- diff --git a/tests/components/wled/test_button.py b/tests/components/wled/test_button.py index 510819da0c7789..fb5a61f114fb98 100644 --- a/tests/components/wled/test_button.py +++ b/tests/components/wled/test_button.py @@ -1,6 +1,7 @@ """Tests for the WLED button platform.""" -from unittest.mock import MagicMock +from collections.abc import Generator +from unittest.mock import MagicMock, patch import pytest from syrupy.assertion import SnapshotAssertion @@ -8,35 +9,68 @@ from homeassistant.components.button import DOMAIN as BUTTON_DOMAIN, SERVICE_PRESS from homeassistant.components.wled.const import DOMAIN -from homeassistant.const import ATTR_ENTITY_ID, STATE_UNAVAILABLE, STATE_UNKNOWN +from homeassistant.const import ( + ATTR_ENTITY_ID, + STATE_UNAVAILABLE, + STATE_UNKNOWN, + Platform, +) from homeassistant.core import HomeAssistant from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers import device_registry as dr, entity_registry as er +from tests.common import MockConfigEntry, snapshot_platform + pytestmark = [ pytest.mark.usefixtures("init_integration"), pytest.mark.freeze_time("2021-11-04 17:36:59+01:00"), ] -async def test_button_restart( +@pytest.fixture(autouse=True) +def override_platforms() -> Generator[None]: + """Override PLATFORMS.""" + with patch("homeassistant.components.wled.PLATFORMS", [Platform.BUTTON]): + yield + + +@pytest.mark.usefixtures("init_integration") +async def test_snapshots( hass: HomeAssistant, - device_registry: dr.DeviceRegistry, entity_registry: er.EntityRegistry, - mock_wled: MagicMock, snapshot: SnapshotAssertion, + mock_config_entry: MockConfigEntry, ) -> None: - """Test the creation and values of the WLED button.""" - assert (state := hass.states.get("button.wled_rgb_light_restart")) - assert state == snapshot + """Test snapshot of the platform.""" + await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id) - assert (entity_entry := entity_registry.async_get(state.entity_id)) - assert entity_entry == snapshot + +@pytest.mark.usefixtures("init_integration") +async def test_device_snapshot( + hass: HomeAssistant, + device_registry: dr.DeviceRegistry, + entity_registry: er.EntityRegistry, + snapshot: SnapshotAssertion, + mock_config_entry: MockConfigEntry, +) -> None: + """Test device snapshot.""" + assert (entity_entry := entity_registry.async_get("button.wled_rgb_light_restart")) assert entity_entry.device_id assert (device_entry := device_registry.async_get(entity_entry.device_id)) assert device_entry == snapshot + +async def test_button_restart( + hass: HomeAssistant, + device_registry: dr.DeviceRegistry, + entity_registry: er.EntityRegistry, + mock_wled: MagicMock, + snapshot: SnapshotAssertion, +) -> None: + """Test the behavior of the restart button.""" + assert (state := hass.states.get("button.wled_rgb_light_restart")) + assert state.state == STATE_UNKNOWN await hass.services.async_call( BUTTON_DOMAIN, @@ -50,24 +84,26 @@ async def test_button_restart( assert (state := hass.states.get("button.wled_rgb_light_restart")) assert state.state == "2021-11-04T16:37:00+00:00" - # Test with WLED error - mock_wled.reset.side_effect = WLEDError - with pytest.raises(HomeAssistantError) as ex: - await hass.services.async_call( - BUTTON_DOMAIN, - SERVICE_PRESS, - {ATTR_ENTITY_ID: "button.wled_rgb_light_restart"}, - blocking=True, - ) - assert ex.value.translation_domain == DOMAIN - assert ex.value.translation_key == "invalid_response_wled_error" - - # Ensure this didn't made the entity unavailable - assert (state := hass.states.get("button.wled_rgb_light_restart")) - assert state.state != STATE_UNAVAILABLE +@pytest.mark.parametrize( + ("side_effect", "expected_state", "expected_translation_key"), + [ + (WLEDError, "2021-11-04T16:37:00+00:00", "invalid_response_wled_error"), + (WLEDConnectionError, STATE_UNAVAILABLE, "connection_error"), + ], +) +async def test_button_restart_errors( + hass: HomeAssistant, + device_registry: dr.DeviceRegistry, + entity_registry: er.EntityRegistry, + mock_wled: MagicMock, + side_effect: Exception, + expected_state: str, + expected_translation_key: str, +) -> None: + """Test the error handling of the restart button.""" # Test with WLED connection error - mock_wled.reset.side_effect = WLEDConnectionError + mock_wled.reset.side_effect = side_effect with pytest.raises(HomeAssistantError) as ex: await hass.services.async_call( BUTTON_DOMAIN, @@ -77,8 +113,8 @@ async def test_button_restart( ) assert ex.value.translation_domain == DOMAIN - assert ex.value.translation_key == "connection_error" + assert ex.value.translation_key == expected_translation_key # Ensure this made the entity unavailable assert (state := hass.states.get("button.wled_rgb_light_restart")) - assert state.state == STATE_UNAVAILABLE + assert state.state == expected_state diff --git a/tests/components/wled/test_config_flow.py b/tests/components/wled/test_config_flow.py index 40758771bb14f4..d43434a1e8819a 100644 --- a/tests/components/wled/test_config_flow.py +++ b/tests/components/wled/test_config_flow.py @@ -15,6 +15,8 @@ from tests.common import MockConfigEntry +CONFIG = {CONF_HOST: "10.10.0.10"} + @pytest.mark.usefixtures("mock_setup_entry", "mock_wled") @pytest.mark.parametrize( @@ -61,7 +63,7 @@ async def test_full_reconfigure_flow_success( assert result.get("step_id") == "user" assert result.get("type") is FlowResultType.FORM result = await hass.config_entries.flow.async_configure( - result["flow_id"], user_input={CONF_HOST: "10.10.0.10"} + result["flow_id"], user_input=CONFIG ) # Assert show text message and close flow @@ -91,7 +93,7 @@ async def test_full_reconfigure_flow_unique_id_mismatch( # Input new host value result = await hass.config_entries.flow.async_configure( - result["flow_id"], user_input={CONF_HOST: "10.10.0.10"} + result["flow_id"], user_input=CONFIG ) # Assert Show text message and close flow @@ -117,7 +119,7 @@ async def test_full_reconfigure_flow_connection_error_and_success( # Input new host value result = await hass.config_entries.flow.async_configure( - result["flow_id"], user_input={CONF_HOST: "10.10.0.10"} + result["flow_id"], user_input=CONFIG ) # Assert form with errors @@ -129,7 +131,7 @@ async def test_full_reconfigure_flow_connection_error_and_success( mock_wled.update.side_effect = None result = await hass.config_entries.flow.async_configure( - result["flow_id"], user_input={CONF_HOST: "10.10.0.10"} + result["flow_id"], user_input=CONFIG ) # Assert show text message and close flow @@ -212,35 +214,27 @@ async def test_zeroconf_during_onboarding( assert len(mock_onboarding.mock_calls) == 1 -async def test_connection_error(hass: HomeAssistant, mock_wled: MagicMock) -> None: - """Test we show user form on WLED connection error.""" - mock_wled.update.side_effect = WLEDConnectionError - result = await hass.config_entries.flow.async_init( - DOMAIN, - context={"source": SOURCE_USER}, - data={CONF_HOST: "example.com"}, - ) - - assert result.get("type") is FlowResultType.FORM - assert result.get("step_id") == "user" - assert result.get("errors") == {"base": "cannot_connect"} - - -async def test_unsupported_version_error( - hass: HomeAssistant, mock_wled: MagicMock +@pytest.mark.parametrize( + ("exception", "errors"), + [ + (WLEDConnectionError, {"base": "cannot_connect"}), + (WLEDUnsupportedVersionError, {"base": "unsupported_version"}), + ], +) +async def test_form_submission_errors( + hass: HomeAssistant, mock_wled: MagicMock, exception: Exception, errors: dict ) -> None: - """Test we show user form on WLED unsupported version error.""" - mock_wled.update.side_effect = WLEDUnsupportedVersionError - + """Test errors during form submission.""" + mock_wled.update.side_effect = exception result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": SOURCE_USER}, - data={CONF_HOST: "example.com"}, + data=CONFIG, ) assert result.get("type") is FlowResultType.FORM assert result.get("step_id") == "user" - assert result.get("errors") == {"base": "unsupported_version"} + assert result.get("errors") == errors async def test_zeroconf_connection_error( diff --git a/tests/components/wled/test_coordinator.py b/tests/components/wled/test_coordinator.py index 0907f3a0de22de..6941640b0dce4a 100644 --- a/tests/components/wled/test_coordinator.py +++ b/tests/components/wled/test_coordinator.py @@ -5,6 +5,7 @@ from copy import deepcopy from unittest.mock import MagicMock +from freezegun.api import FrozenDateTimeFactory import pytest from wled import ( Device as WLEDDevice, @@ -23,7 +24,6 @@ STATE_UNAVAILABLE, ) from homeassistant.core import HomeAssistant -from homeassistant.util import dt as dt_util from tests.common import MockConfigEntry, async_fire_time_changed @@ -37,13 +37,18 @@ async def test_not_supporting_websocket( @pytest.mark.parametrize("device_fixture", ["rgb_websocket"]) async def test_websocket_already_connected( - hass: HomeAssistant, init_integration: MockConfigEntry, mock_wled: MagicMock + hass: HomeAssistant, + init_integration: MockConfigEntry, + mock_wled: MagicMock, + freezer: FrozenDateTimeFactory, ) -> None: """Ensure no a second WebSocket connection is made, if already connected.""" assert mock_wled.connect.call_count == 1 mock_wled.connected = True - async_fire_time_changed(hass, dt_util.utcnow() + SCAN_INTERVAL) + + freezer.tick(SCAN_INTERVAL) + async_fire_time_changed(hass) await hass.async_block_till_done() assert mock_wled.connect.call_count == 1 @@ -54,13 +59,15 @@ async def test_websocket_connect_error_no_listen( hass: HomeAssistant, init_integration: MockConfigEntry, mock_wled: MagicMock, + freezer: FrozenDateTimeFactory, ) -> None: """Ensure we don't start listening if WebSocket connection failed.""" assert mock_wled.connect.call_count == 1 assert mock_wled.listen.call_count == 1 mock_wled.connect.side_effect = WLEDConnectionError - async_fire_time_changed(hass, dt_util.utcnow() + SCAN_INTERVAL) + freezer.tick(SCAN_INTERVAL) + async_fire_time_changed(hass) await hass.async_block_till_done() assert mock_wled.connect.call_count == 2 @@ -72,6 +79,7 @@ async def test_websocket( hass: HomeAssistant, init_integration: MockConfigEntry, mock_wled: MagicMock, + freezer: FrozenDateTimeFactory, ) -> None: """Test WebSocket connection.""" state = hass.states.get("light.wled_websocket") @@ -98,7 +106,8 @@ async def connect(callback: Callable[[WLEDDevice], None]): hass.bus = mock_bus # Next refresh it should connect - async_fire_time_changed(hass, dt_util.utcnow() + SCAN_INTERVAL) + freezer.tick(SCAN_INTERVAL) + async_fire_time_changed(hass) callback = await connection_connected # Connected to WebSocket, disconnect not called @@ -145,6 +154,7 @@ async def test_websocket_error( hass: HomeAssistant, init_integration: MockConfigEntry, mock_wled: MagicMock, + freezer: FrozenDateTimeFactory, ) -> None: """Test WebSocket connection erroring out, marking lights unavailable.""" state = hass.states.get("light.wled_websocket") @@ -159,7 +169,8 @@ async def connect(callback: Callable[[WLEDDevice], None]): await connection_finished mock_wled.listen.side_effect = connect - async_fire_time_changed(hass, dt_util.utcnow() + SCAN_INTERVAL) + freezer.tick(SCAN_INTERVAL) + async_fire_time_changed(hass) await connection_connected # Resolve Future with an error. @@ -177,6 +188,7 @@ async def test_websocket_disconnect_on_home_assistant_stop( hass: HomeAssistant, init_integration: MockConfigEntry, mock_wled: MagicMock, + freezer: FrozenDateTimeFactory, ) -> None: """Ensure WebSocket is disconnected when Home Assistant stops.""" assert mock_wled.disconnect.call_count == 1 @@ -188,7 +200,8 @@ async def connect(callback: Callable[[WLEDDevice], None]): await connection_finished mock_wled.listen.side_effect = connect - async_fire_time_changed(hass, dt_util.utcnow() + SCAN_INTERVAL) + freezer.tick(SCAN_INTERVAL) + async_fire_time_changed(hass) await connection_connected assert mock_wled.disconnect.call_count == 1 diff --git a/tests/components/wled/test_light.py b/tests/components/wled/test_light.py index 90e731f3fe9b45..412720ae89ea8e 100644 --- a/tests/components/wled/test_light.py +++ b/tests/components/wled/test_light.py @@ -1,9 +1,11 @@ """Tests for the WLED light platform.""" -from unittest.mock import MagicMock +from collections.abc import Generator +from unittest.mock import MagicMock, patch from freezegun.api import FrozenDateTimeFactory import pytest +from syrupy.assertion import SnapshotAssertion from wled import Device as WLEDDevice, WLEDConnectionError, WLEDError from homeassistant.components.light import ( @@ -11,7 +13,6 @@ ATTR_COLOR_MODE, ATTR_COLOR_TEMP_KELVIN, ATTR_EFFECT, - ATTR_HS_COLOR, ATTR_MAX_COLOR_TEMP_KELVIN, ATTR_MIN_COLOR_TEMP_KELVIN, ATTR_RGB_COLOR, @@ -28,12 +29,12 @@ ) from homeassistant.const import ( ATTR_ENTITY_ID, - ATTR_ICON, SERVICE_TURN_OFF, SERVICE_TURN_ON, STATE_OFF, STATE_ON, STATE_UNAVAILABLE, + Platform, ) from homeassistant.core import HomeAssistant from homeassistant.exceptions import HomeAssistantError @@ -43,44 +44,30 @@ MockConfigEntry, async_fire_time_changed, async_load_json_object_fixture, + snapshot_platform, ) pytestmark = pytest.mark.usefixtures("init_integration") -async def test_rgb_light_state( - hass: HomeAssistant, entity_registry: er.EntityRegistry -) -> None: - """Test the creation and values of the WLED lights.""" - # First segment of the strip - assert (state := hass.states.get("light.wled_rgb_light")) - assert state.attributes.get(ATTR_BRIGHTNESS) == 255 - assert state.attributes.get(ATTR_EFFECT) == "Solid" - assert state.attributes.get(ATTR_HS_COLOR) == (218.906, 50.196) - assert state.attributes.get(ATTR_ICON) is None - assert state.state == STATE_ON - - assert (entry := entity_registry.async_get("light.wled_rgb_light")) - assert entry.unique_id == "aabbccddeeff_0" +@pytest.fixture(autouse=True) +def override_platforms() -> Generator[None]: + """Override PLATFORMS.""" + with patch("homeassistant.components.wled.PLATFORMS", [Platform.LIGHT]): + yield - # Second segment of the strip - assert (state := hass.states.get("light.wled_rgb_light_segment_1")) - assert state.attributes.get(ATTR_BRIGHTNESS) == 255 - assert state.attributes.get(ATTR_EFFECT) == "Wipe" - assert state.attributes.get(ATTR_HS_COLOR) == (40.0, 100.0) - assert state.attributes.get(ATTR_ICON) is None - assert state.state == STATE_ON - - assert (entry := entity_registry.async_get("light.wled_rgb_light_segment_1")) - assert entry.unique_id == "aabbccddeeff_1" - # Test main control of the lightstrip - assert (state := hass.states.get("light.wled_rgb_light_main")) - assert state.attributes.get(ATTR_BRIGHTNESS) == 128 - assert state.state == STATE_ON - - assert (entry := entity_registry.async_get("light.wled_rgb_light_main")) - assert entry.unique_id == "aabbccddeeff" +@pytest.mark.parametrize( + "device_fixture", ["cct", "rgb_single_segment", "rgb", "rgb_websocket", "rgbw"] +) +async def test_snapshots( + hass: HomeAssistant, + entity_registry: er.EntityRegistry, + snapshot: SnapshotAssertion, + mock_config_entry: MockConfigEntry, +) -> None: + """Test snapshots of the platform.""" + await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id) async def test_segment_change_state( @@ -293,14 +280,24 @@ async def test_single_segment_behavior( mock_wled.master.assert_called_with(on=True, transition=50, brightness=42) -async def test_light_error( +@pytest.mark.parametrize( + ("side_effect", "expected_state", "expected_translation_key"), + [ + (WLEDError, STATE_ON, "invalid_response_wled_error"), + (WLEDConnectionError, STATE_UNAVAILABLE, "connection_error"), + ], +) +async def test_light_errors( hass: HomeAssistant, mock_wled: MagicMock, + side_effect: Exception, + expected_state: str, + expected_translation_key: str, ) -> None: """Test error handling of the WLED lights.""" - mock_wled.segment.side_effect = WLEDError + mock_wled.segment.side_effect = side_effect - with pytest.raises(HomeAssistantError, match="Invalid response from WLED API"): + with pytest.raises(HomeAssistantError) as ex: await hass.services.async_call( LIGHT_DOMAIN, SERVICE_TURN_OFF, @@ -308,29 +305,11 @@ async def test_light_error( blocking=True, ) - assert (state := hass.states.get("light.wled_rgb_light")) - assert state.state == STATE_ON - assert mock_wled.segment.call_count == 1 - mock_wled.segment.assert_called_with(on=False, segment_id=0, transition=None) - - -async def test_light_connection_error( - hass: HomeAssistant, - mock_wled: MagicMock, -) -> None: - """Test error handling of the WLED switches.""" - mock_wled.segment.side_effect = WLEDConnectionError - - with pytest.raises(HomeAssistantError, match="Error communicating with WLED API"): - await hass.services.async_call( - LIGHT_DOMAIN, - SERVICE_TURN_OFF, - {ATTR_ENTITY_ID: "light.wled_rgb_light"}, - blocking=True, - ) + assert ex.value.translation_domain == DOMAIN + assert ex.value.translation_key == expected_translation_key assert (state := hass.states.get("light.wled_rgb_light")) - assert state.state == STATE_UNAVAILABLE + assert state.state == expected_state assert mock_wled.segment.call_count == 1 mock_wled.segment.assert_called_with(on=False, segment_id=0, transition=None) diff --git a/tests/components/wled/test_number.py b/tests/components/wled/test_number.py index cf89684197199f..a99f72d1dd4341 100644 --- a/tests/components/wled/test_number.py +++ b/tests/components/wled/test_number.py @@ -1,6 +1,7 @@ """Tests for the WLED number platform.""" -from unittest.mock import MagicMock +from collections.abc import Generator +from unittest.mock import MagicMock, patch from freezegun.api import FrozenDateTimeFactory import pytest @@ -13,16 +14,38 @@ SERVICE_SET_VALUE, ) from homeassistant.components.wled.const import DOMAIN, SCAN_INTERVAL -from homeassistant.const import ATTR_ENTITY_ID, STATE_UNAVAILABLE +from homeassistant.const import ATTR_ENTITY_ID, STATE_UNAVAILABLE, Platform from homeassistant.core import HomeAssistant from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers import device_registry as dr, entity_registry as er -from tests.common import async_fire_time_changed, async_load_json_object_fixture +from tests.common import ( + MockConfigEntry, + async_fire_time_changed, + async_load_json_object_fixture, + snapshot_platform, +) pytestmark = pytest.mark.usefixtures("init_integration") +@pytest.fixture(autouse=True) +def override_platforms() -> Generator[None]: + """Override PLATFORMS.""" + with patch("homeassistant.components.wled.PLATFORMS", [Platform.NUMBER]): + yield + + +async def test_snapshots( + hass: HomeAssistant, + entity_registry: er.EntityRegistry, + snapshot: SnapshotAssertion, + mock_config_entry: MockConfigEntry, +) -> None: + """Test snapshot of the platform.""" + await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id) + + @pytest.mark.parametrize( ("entity_id", "value", "called_arg"), [ diff --git a/tests/components/wled/test_select.py b/tests/components/wled/test_select.py index 6325905fa0a379..fe4f45f9458432 100644 --- a/tests/components/wled/test_select.py +++ b/tests/components/wled/test_select.py @@ -1,7 +1,8 @@ """Tests for the WLED select platform.""" +from collections.abc import Generator import typing -from unittest.mock import MagicMock +from unittest.mock import MagicMock, patch from freezegun.api import FrozenDateTimeFactory import pytest @@ -17,16 +18,43 @@ from homeassistant.components.select import ATTR_OPTION, DOMAIN as SELECT_DOMAIN from homeassistant.components.wled.const import DOMAIN, SCAN_INTERVAL -from homeassistant.const import ATTR_ENTITY_ID, SERVICE_SELECT_OPTION, STATE_UNAVAILABLE +from homeassistant.const import ( + ATTR_ENTITY_ID, + SERVICE_SELECT_OPTION, + STATE_UNAVAILABLE, + Platform, +) from homeassistant.core import HomeAssistant from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers import device_registry as dr, entity_registry as er -from tests.common import async_fire_time_changed, async_load_json_object_fixture +from tests.common import ( + MockConfigEntry, + async_fire_time_changed, + async_load_json_object_fixture, + snapshot_platform, +) pytestmark = pytest.mark.usefixtures("init_integration") +@pytest.fixture(autouse=True) +def override_platforms() -> Generator[None]: + """Override PLATFORMS.""" + with patch("homeassistant.components.wled.PLATFORMS", [Platform.SELECT]): + yield + + +async def test_snapshots( + hass: HomeAssistant, + entity_registry: er.EntityRegistry, + snapshot: SnapshotAssertion, + mock_config_entry: MockConfigEntry, +) -> None: + """Test snapshots of the platform.""" + await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id) + + @pytest.mark.parametrize( ("device_fixture", "entity_id", "option", "method", "called_with"), [ @@ -71,24 +99,13 @@ async def test_color_palette_state( method: str, called_with: dict[str, int | str], ) -> None: - """Test the creation and values of the WLED selects.""" - # First segment of the strip - assert (state := hass.states.get(entity_id)) - assert state == snapshot - - assert (entity_entry := entity_registry.async_get(state.entity_id)) - assert entity_entry == snapshot - - assert entity_entry.device_id - assert (device_entry := device_registry.async_get(entity_entry.device_id)) - assert device_entry == snapshot - + """Test the behavior of the WLED selects.""" method_mock = getattr(mock_wled, method) await hass.services.async_call( SELECT_DOMAIN, SERVICE_SELECT_OPTION, - {ATTR_ENTITY_ID: state.entity_id, ATTR_OPTION: option}, + {ATTR_ENTITY_ID: entity_id, ATTR_OPTION: option}, blocking=True, ) assert method_mock.call_count == 1 @@ -100,11 +117,11 @@ async def test_color_palette_state( await hass.services.async_call( SELECT_DOMAIN, SERVICE_SELECT_OPTION, - {ATTR_ENTITY_ID: state.entity_id, ATTR_OPTION: option}, + {ATTR_ENTITY_ID: entity_id, ATTR_OPTION: option}, blocking=True, ) - assert (state := hass.states.get(state.entity_id)) + assert (state := hass.states.get(entity_id)) assert state.state != STATE_UNAVAILABLE assert method_mock.call_count == 2 method_mock.assert_called_with(**called_with) diff --git a/tests/components/wled/test_sensor.py b/tests/components/wled/test_sensor.py index 5b19967170be1a..65ab75fa6ae5d3 100644 --- a/tests/components/wled/test_sensor.py +++ b/tests/components/wled/test_sensor.py @@ -1,126 +1,38 @@ """Tests for the WLED sensor platform.""" -from datetime import datetime +from collections.abc import Generator from unittest.mock import MagicMock, patch from freezegun.api import FrozenDateTimeFactory import pytest +from syrupy.assertion import SnapshotAssertion -from homeassistant.components.sensor import SensorDeviceClass from homeassistant.components.wled.const import SCAN_INTERVAL -from homeassistant.const import ( - ATTR_DEVICE_CLASS, - ATTR_ICON, - ATTR_UNIT_OF_MEASUREMENT, - PERCENTAGE, - SIGNAL_STRENGTH_DECIBELS_MILLIWATT, - STATE_UNKNOWN, - EntityCategory, - UnitOfElectricCurrent, - UnitOfInformation, -) +from homeassistant.const import STATE_UNKNOWN, Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er -from homeassistant.util import dt as dt_util -from tests.common import MockConfigEntry, async_fire_time_changed +from tests.common import MockConfigEntry, async_fire_time_changed, snapshot_platform + +@pytest.fixture(autouse=True) +def override_platforms() -> Generator[None]: + """Override PLATFORMS.""" + with patch("homeassistant.components.wled.PLATFORMS", [Platform.SENSOR]): + yield -@pytest.mark.usefixtures("entity_registry_enabled_by_default", "mock_wled") -async def test_sensors( + +@pytest.mark.usefixtures("init_integration") +@pytest.mark.usefixtures("entity_registry_enabled_by_default") +@pytest.mark.freeze_time("2021-11-04 17:36:59+01:00") +async def test_snapshots( hass: HomeAssistant, - mock_config_entry: MockConfigEntry, entity_registry: er.EntityRegistry, + snapshot: SnapshotAssertion, + mock_config_entry: MockConfigEntry, ) -> None: - """Test the creation and values of the WLED sensors.""" - mock_config_entry.add_to_hass(hass) - - test_time = datetime(2019, 11, 11, 9, 10, 32, tzinfo=dt_util.UTC) - with patch("homeassistant.components.wled.sensor.utcnow", return_value=test_time): - await hass.config_entries.async_setup(mock_config_entry.entry_id) - await hass.async_block_till_done() - - assert (state := hass.states.get("sensor.wled_rgb_light_estimated_current")) - assert ( - state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) - == UnitOfElectricCurrent.MILLIAMPERE - ) - assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.CURRENT - assert state.state == "515" - - assert ( - entry := entity_registry.async_get("sensor.wled_rgb_light_estimated_current") - ) - assert entry.unique_id == "aabbccddeeff_estimated_current" - assert entry.entity_category is EntityCategory.DIAGNOSTIC - - assert (state := hass.states.get("sensor.wled_rgb_light_uptime")) - assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.TIMESTAMP - assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) is None - assert state.state == "2019-11-11T08:54:26+00:00" - - assert (entry := entity_registry.async_get("sensor.wled_rgb_light_uptime")) - assert entry.unique_id == "aabbccddeeff_uptime" - assert entry.entity_category is EntityCategory.DIAGNOSTIC - - assert (state := hass.states.get("sensor.wled_rgb_light_free_memory")) - assert state.attributes.get(ATTR_ICON) is None - assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UnitOfInformation.BYTES - assert state.state == "198384" - assert entry.entity_category is EntityCategory.DIAGNOSTIC - - assert (entry := entity_registry.async_get("sensor.wled_rgb_light_free_memory")) - assert entry.unique_id == "aabbccddeeff_free_heap" - assert entry.entity_category is EntityCategory.DIAGNOSTIC - - assert (state := hass.states.get("sensor.wled_rgb_light_wi_fi_signal")) - assert state.attributes.get(ATTR_ICON) is None - assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == PERCENTAGE - assert state.state == "100" - assert entry.entity_category is EntityCategory.DIAGNOSTIC - - assert (entry := entity_registry.async_get("sensor.wled_rgb_light_wi_fi_signal")) - assert entry.unique_id == "aabbccddeeff_wifi_signal" - assert entry.entity_category is EntityCategory.DIAGNOSTIC - - assert (state := hass.states.get("sensor.wled_rgb_light_wi_fi_rssi")) - assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.SIGNAL_STRENGTH - assert ( - state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) - == SIGNAL_STRENGTH_DECIBELS_MILLIWATT - ) - assert state.state == "-43" - - assert (entry := entity_registry.async_get("sensor.wled_rgb_light_wi_fi_rssi")) - assert entry.unique_id == "aabbccddeeff_wifi_rssi" - assert entry.entity_category is EntityCategory.DIAGNOSTIC - - assert (state := hass.states.get("sensor.wled_rgb_light_wi_fi_channel")) - assert state.attributes.get(ATTR_ICON) is None - assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) is None - assert state.state == "11" - - assert (entry := entity_registry.async_get("sensor.wled_rgb_light_wi_fi_channel")) - assert entry.unique_id == "aabbccddeeff_wifi_channel" - assert entry.entity_category is EntityCategory.DIAGNOSTIC - - assert (state := hass.states.get("sensor.wled_rgb_light_wi_fi_bssid")) - assert state.attributes.get(ATTR_ICON) is None - assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) is None - assert state.state == "AA:AA:AA:AA:AA:BB" - - assert (entry := entity_registry.async_get("sensor.wled_rgb_light_wi_fi_bssid")) - assert entry.unique_id == "aabbccddeeff_wifi_bssid" - assert entry.entity_category is EntityCategory.DIAGNOSTIC - - assert (state := hass.states.get("sensor.wled_rgb_light_ip")) - assert state.attributes.get(ATTR_ICON) is None - assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) is None - assert state.state == "127.0.0.1" - - assert (entry := entity_registry.async_get("sensor.wled_rgb_light_ip")) - assert entry.unique_id == "aabbccddeeff_ip" - assert entry.entity_category is EntityCategory.DIAGNOSTIC + """Test snapshot of the platform.""" + await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id) @pytest.mark.parametrize( diff --git a/tests/components/wled/test_switch.py b/tests/components/wled/test_switch.py index c64c774f82ded5..d9088b8b593965 100644 --- a/tests/components/wled/test_switch.py +++ b/tests/components/wled/test_switch.py @@ -1,6 +1,7 @@ """Tests for the WLED switch platform.""" -from unittest.mock import MagicMock +from collections.abc import Generator +from unittest.mock import MagicMock, patch from freezegun.api import FrozenDateTimeFactory import pytest @@ -16,16 +17,40 @@ STATE_OFF, STATE_ON, STATE_UNAVAILABLE, + Platform, ) from homeassistant.core import HomeAssistant from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers import device_registry as dr, entity_registry as er -from tests.common import async_fire_time_changed, async_load_json_object_fixture +from tests.common import ( + MockConfigEntry, + async_fire_time_changed, + async_load_json_object_fixture, + snapshot_platform, +) pytestmark = pytest.mark.usefixtures("init_integration") +@pytest.fixture(autouse=True) +def override_platforms() -> Generator[None]: + """Override PLATFORMS.""" + with patch("homeassistant.components.wled.PLATFORMS", [Platform.SWITCH]): + yield + + +@pytest.mark.parametrize("device_fixture", ["rgb_single_segment", "rgb"]) +async def test_snapshots( + hass: HomeAssistant, + entity_registry: er.EntityRegistry, + snapshot: SnapshotAssertion, + mock_config_entry: MockConfigEntry, +) -> None: + """Test snapshot of the platform.""" + await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id) + + @pytest.mark.parametrize( ("entity_id", "method", "called_with_on", "called_with_off"), [ @@ -66,24 +91,14 @@ async def test_switch_state( called_with_on: dict[str, bool | int], called_with_off: dict[str, bool | int], ) -> None: - """Test the creation and values of the WLED switches.""" - assert (state := hass.states.get(entity_id)) - assert state == snapshot - - assert (entity_entry := entity_registry.async_get(state.entity_id)) - assert entity_entry == snapshot - - assert entity_entry.device_id - assert (device_entry := device_registry.async_get(entity_entry.device_id)) - assert device_entry == snapshot - + """Test the behavior of the switch.""" # Test on/off services method_mock = getattr(mock_wled, method) await hass.services.async_call( SWITCH_DOMAIN, SERVICE_TURN_ON, - {ATTR_ENTITY_ID: state.entity_id}, + {ATTR_ENTITY_ID: entity_id}, blocking=True, ) @@ -93,7 +108,7 @@ async def test_switch_state( await hass.services.async_call( SWITCH_DOMAIN, SERVICE_TURN_OFF, - {ATTR_ENTITY_ID: state.entity_id}, + {ATTR_ENTITY_ID: entity_id}, blocking=True, ) @@ -106,12 +121,12 @@ async def test_switch_state( await hass.services.async_call( SWITCH_DOMAIN, SERVICE_TURN_ON, - {ATTR_ENTITY_ID: state.entity_id}, + {ATTR_ENTITY_ID: entity_id}, blocking=True, ) assert method_mock.call_count == 3 - assert (state := hass.states.get(state.entity_id)) + assert (state := hass.states.get(entity_id)) assert state.state != STATE_UNAVAILABLE # Test connection error, leading to becoming unavailable diff --git a/tests/components/wled/test_update.py b/tests/components/wled/test_update.py index 152ebe041b183f..b28ed0e23ee637 100644 --- a/tests/components/wled/test_update.py +++ b/tests/components/wled/test_update.py @@ -1,71 +1,56 @@ """Tests for the WLED update platform.""" -from unittest.mock import MagicMock +from collections.abc import Generator +from unittest.mock import MagicMock, patch from freezegun.api import FrozenDateTimeFactory import pytest +from syrupy.assertion import SnapshotAssertion from wled import Releases, WLEDError from homeassistant.components.update import ( ATTR_INSTALLED_VERSION, ATTR_LATEST_VERSION, - ATTR_RELEASE_SUMMARY, - ATTR_RELEASE_URL, - ATTR_TITLE, DOMAIN as UPDATE_DOMAIN, SERVICE_INSTALL, - UpdateDeviceClass, - UpdateEntityFeature, ) from homeassistant.components.wled.const import RELEASES_SCAN_INTERVAL from homeassistant.const import ( - ATTR_DEVICE_CLASS, ATTR_ENTITY_ID, - ATTR_ENTITY_PICTURE, - ATTR_ICON, - ATTR_SUPPORTED_FEATURES, STATE_OFF, STATE_ON, STATE_UNAVAILABLE, STATE_UNKNOWN, - EntityCategory, + Platform, ) from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er -from tests.common import async_fire_time_changed +from tests.common import MockConfigEntry, async_fire_time_changed, snapshot_platform pytestmark = pytest.mark.usefixtures("init_integration") +@pytest.fixture(autouse=True) +def override_platforms() -> Generator[None]: + """Override PLATFORMS.""" + with patch("homeassistant.components.wled.PLATFORMS", [Platform.UPDATE]): + yield + + async def test_update_available( - hass: HomeAssistant, entity_registry: er.EntityRegistry + hass: HomeAssistant, + entity_registry: er.EntityRegistry, + snapshot: SnapshotAssertion, + mock_config_entry: MockConfigEntry, ) -> None: - """Test the firmware update available.""" + """Test states of the update.""" + await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id) + assert (state := hass.states.get("update.wled_rgb_light_firmware")) - assert state.attributes.get(ATTR_DEVICE_CLASS) == UpdateDeviceClass.FIRMWARE assert state.state == STATE_ON - assert ( - state.attributes[ATTR_ENTITY_PICTURE] - == "https://brands.home-assistant.io/_/wled/icon.png" - ) - assert state.attributes[ATTR_INSTALLED_VERSION] == "0.14.4" - assert state.attributes[ATTR_LATEST_VERSION] == "0.99.0" - assert state.attributes[ATTR_RELEASE_SUMMARY] is None - assert ( - state.attributes[ATTR_RELEASE_URL] - == "https://github.com/wled/WLED/releases/tag/v0.99.0" - ) - assert ( - state.attributes[ATTR_SUPPORTED_FEATURES] - == UpdateEntityFeature.INSTALL | UpdateEntityFeature.SPECIFIC_VERSION - ) - assert state.attributes[ATTR_TITLE] == "WLED" - assert ATTR_ICON not in state.attributes - assert (entry := entity_registry.async_get("update.wled_rgb_light_firmware")) - assert entry.unique_id == "aabbccddeeff" - assert entry.entity_category is EntityCategory.CONFIG + assert snapshot == state async def test_update_information_available( @@ -73,6 +58,7 @@ async def test_update_information_available( freezer: FrozenDateTimeFactory, entity_registry: er.EntityRegistry, mock_wled_releases: MagicMock, + snapshot: SnapshotAssertion, ) -> None: """Test having no update information available at all.""" mock_wled_releases.releases.return_value = Releases( @@ -85,53 +71,23 @@ async def test_update_information_available( await hass.async_block_till_done() assert (state := hass.states.get("update.wled_rgb_light_firmware")) - assert state.attributes.get(ATTR_DEVICE_CLASS) == UpdateDeviceClass.FIRMWARE assert state.state == STATE_UNKNOWN - assert state.attributes[ATTR_INSTALLED_VERSION] == "0.14.4" - assert state.attributes[ATTR_LATEST_VERSION] is None - assert state.attributes[ATTR_RELEASE_SUMMARY] is None - assert state.attributes[ATTR_RELEASE_URL] is None - assert ( - state.attributes[ATTR_SUPPORTED_FEATURES] - == UpdateEntityFeature.INSTALL | UpdateEntityFeature.SPECIFIC_VERSION - ) - assert state.attributes[ATTR_TITLE] == "WLED" - assert ATTR_ICON not in state.attributes - entry = entity_registry.async_get("update.wled_rgb_light_firmware") - assert entry - assert entry.unique_id == "aabbccddeeff" - assert entry.entity_category is EntityCategory.CONFIG + assert snapshot == state @pytest.mark.usefixtures("entity_registry_enabled_by_default") @pytest.mark.parametrize("device_fixture", ["rgb_websocket"]) async def test_no_update_available( - hass: HomeAssistant, entity_registry: er.EntityRegistry + hass: HomeAssistant, + entity_registry: er.EntityRegistry, + snapshot: SnapshotAssertion, ) -> None: """Test there is no update available.""" assert (state := hass.states.get("update.wled_websocket_firmware")) assert state.state == STATE_OFF - assert state.attributes.get(ATTR_DEVICE_CLASS) == UpdateDeviceClass.FIRMWARE - assert state.attributes[ATTR_INSTALLED_VERSION] == "0.99.0" - assert state.attributes[ATTR_LATEST_VERSION] == "0.99.0" - assert state.attributes[ATTR_RELEASE_SUMMARY] is None - assert ( - state.attributes[ATTR_RELEASE_URL] - == "https://github.com/wled/WLED/releases/tag/v0.99.0" - ) - assert ( - state.attributes[ATTR_SUPPORTED_FEATURES] - == UpdateEntityFeature.INSTALL | UpdateEntityFeature.SPECIFIC_VERSION - ) - assert state.attributes[ATTR_TITLE] == "WLED" - assert ATTR_ICON not in state.attributes - - assert ATTR_ICON not in state.attributes - assert (entry := entity_registry.async_get("update.wled_websocket_firmware")) - assert entry.unique_id == "aabbccddeeff" - assert entry.entity_category is EntityCategory.CONFIG + assert snapshot == state async def test_update_error(