1
0
mirror of https://github.com/home-assistant/core.git synced 2025-08-11 06:20:01 +00:00
Files
.devcontainer
.github
.vscode
homeassistant
machine
pylint
rootfs
script
tests
auth
components
abode
accuweather
acmeda
adax
adguard
advantage_air
aemet
aftership
agent_dvr
air_quality
airly
airnow
airq
airthings
airthings_ble
airtouch4
airtouch5
airvisual
airvisual_pro
airzone
airzone_cloud
aladdin_connect
alarm_control_panel
alarmdecoder
alert
alexa
amberelectric
ambiclimate
ambient_network
ambient_station
analytics
analytics_insights
android_ip_webcam
androidtv
androidtv_remote
anova
anthemav
aosmith
apache_kafka
apcupsd
api
api_streams
apple_tv
application_credentials
apprise
aprilaire
aprs
aranet
arcam_fmj
arve
aseko_pool_live
assist_pipeline
asterisk_mbox
asuswrt
atag
august
aurora
aurora_abb_powerone
aussie_broadband
auth
automation
awair
aws
axis
azure_devops
azure_event_hub
backup
baf
balboa
bang_olufsen
bayesian
binary_sensor
blackbird
blebox
blink
blue_current
bluemaestro
blueprint
bluetooth
bluetooth_adapters
bluetooth_le_tracker
bmw_connected_drive
bond
bosch_shc
braviatv
bring
broadlink
brother
brottsplatskartan
brunt
bsblan
bthome
buienradar
button
caldav
calendar
camera
canary
cast
ccm15
cert_expiry
clicksend_tts
climate
cloud
cloudflare
co2signal
coinbase
color_extractor
comelit
comfoconnect
command_line
compensation
config
configurator
control4
conversation
coolmaster
counter
cover
cpuspeed
crownstone
daikin
datadog
date
datetime
debugpy
deconz
default_config
deluge
demo
denonavr
derivative
devialet
device_automation
device_sun_light_trigger
device_tracker
devolo_home_control
devolo_home_network
dexcom
dhcp
diagnostics
dialogflow
directv
discord
discovergy
dlink
dlna_dmr
dlna_dms
dnsip
doorbird
dormakaba_dkey
downloader
dremel_3d_printer
drop_connect
dsmr
dsmr_reader
dte_energy_bridge
duckdns
dunehd
duotecno
dwd_weather_warnings
dynalite
eafm
easyenergy
ecobee
ecoforest
econet
ecovacs
ecowitt
edl21
efergy
eight_sleep
electrasmart
electric_kiwi
elgato
elkm1
elmax
elvia
emonitor
emulated_hue
emulated_kasa
emulated_roku
energenie_power_sockets
energy
energyzero
enigma2
enocean
enphase_envoy
environment_canada
epic_games_store
epion
epson
eq3btsmart
escea
esphome
eufylife_ble
event
everlights
evil_genius_labs
ezviz
faa_delays
facebook
fail2ban
fan
fastdotcom
feedreader
ffmpeg
fibaro
fido
file
file_upload
filesize
filter
fints
fireservicerota
firmata
fitbit
fivem
fjaraskupan
flexit_bacnet
flic
flick_electric
flipr
flo
flume
flux
flux_led
__init__.py
conftest.py
test_button.py
test_config_flow.py
test_diagnostics.py
test_init.py
test_light.py
test_number.py
test_select.py
test_sensor.py
test_switch.py
folder
folder_watcher
foobot
forecast_solar
forked_daapd
foscam
freebox
freedns
freedompro
fritz
fritzbox
fritzbox_callmonitor
fronius
frontend
frontier_silicon
fully_kiosk
fyta
garages_amsterdam
gardena_bluetooth
gdacs
generic
generic_hygrostat
generic_thermostat
geo_json_events
geo_location
geo_rss_events
geocaching
geofency
geonetnz_quakes
geonetnz_volcano
gios
github
glances
goalzero
gogogate2
goodwe
google
google_assistant
google_assistant_sdk
google_domains
google_generative_ai_conversation
google_mail
google_pubsub
google_sheets
google_tasks
google_translate
google_travel_time
google_wifi
govee_ble
govee_light_local
gpsd
gpslogger
graphite
gree
greeneye_monitor
group
growatt_server
guardian
habitica
hardkernel
hardware
harmony
hassio
hddtemp
hdmi_cec
heos
here_travel_time
hisense_aehw4a1
history
history_stats
hive
hko
hlk_sw16
holiday
home_connect
homeassistant
homeassistant_alerts
homeassistant_green
homeassistant_hardware
homeassistant_sky_connect
homeassistant_yellow
homekit
homekit_controller
homematic
homematicip_cloud
homewizard
homeworks
honeywell
html5
http
huawei_lte
hue
huisbaasje
humidifier
hunterdouglas_powerview
husqvarna_automower
huum
hvv_departures
hydrawise
hyperion
ialarm
iaqualink
ibeacon
icloud
idasen_desk
ifttt
ign_sismologia
image
image_processing
image_upload
imap
imgw_pib
improv_ble
influxdb
inkbird
input_boolean
input_button
input_datetime
input_number
input_select
input_text
insteon
integration
intellifire
intent
intent_script
ios
iotawatt
ipma
ipp
iqvia
islamic_prayer_times
iss
isy994
izone
jellyfin
jewish_calendar
juicenet
justnimbus
jvc_projector
kaleidescape
keenetic_ndms2
kegtron
keymitt_ble
kira
kitchen_sink
kmtronic
knx
kodi
konnected
kostal_plenticore
kraken
kulersky
lacrosse_view
lamarzocco
lametric
landisgyr_heat_meter
lastfm
launch_library
laundrify
lawn_mower
lcn
ld2410_ble
leaone
led_ble
lg_netcast
lg_soundbar
lidarr
life360
lifx
light
linear_garage_door
litejet
litterrobot
livisi
local_calendar
local_file
local_ip
local_todo
locative
lock
logbook
logentries
logger
logi_circle
london_air
london_underground
lookin
loqed
lovelace
luftdaten
lupusec
lutron
lutron_caseta
lyric
mailbox
mailgun
manual
manual_mqtt
map
marytts
matrix
matter
maxcube
mazda
meater
medcom_ble
media_extractor
media_player
media_source
melcloud
melissa
melnor
meraki
met
met_eireann
meteo_france
meteoclimatic
metoffice
mfi
microbees
microsoft
microsoft_face
microsoft_face_detect
microsoft_face_identify
mikrotik
mill
min_max
minecraft_server
minio
mjpeg
moat
mobile_app
mochad
modbus
modem_callerid
modern_forms
moehlenhoff_alpha2
mold_indicator
monoprice
moon
mopeka
motion_blinds
motionblinds_ble
motioneye
motionmount
mqtt
mqtt_eventstream
mqtt_json
mqtt_room
mqtt_statestream
mullvad
mutesync
my
myq
mysensors
mystrom
mythicbeastsdns
myuplink
nam
namecheapdns
nanoleaf
neato
ness_alarm
nest
netatmo
netgear
netgear_lte
network
nexia
nextbus
nextcloud
nextdns
nfandroidtv
nibe_heatpump
nightscout
nina
nmap_tracker
no_ip
nobo_hub
notify
notify_events
notion
nsw_fuel_station
nsw_rural_fire_service_feed
nuheat
nuki
numato
number
nut
nws
nx584
nzbget
obihai
octoprint
ollama
omnilogic
onboarding
oncue
ondilo_ico
onewire
onvif
open_meteo
openai_conversation
openalpr_cloud
openerz
openexchangerates
opengarage
openhardwaremonitor
openhome
opensky
opentherm_gw
openuv
openweathermap
opnsense
opower
oralb
osoenergy
otbr
ourgroceries
overkiz
ovo_energy
owntracks
p1_monitor
panasonic_viera
panel_custom
panel_iframe
peco
pegel_online
permobil
persistent_notification
person
philips_js
pi_hole
picnic
pilight
ping
pjlink
plaato
plant
plex
plugwise
plum_lightpad
point
poolsense
powerwall
private_ble_device
profiler
progettihwsw
prometheus
prosegur
proximity
prusalink
ps4
pure_energie
purpleair
push
pushbullet
pushover
pvoutput
pvpc_hourly_pricing
python_script
qbittorrent
qingping
qld_bushfire
qnap
qnap_qsw
qwikswitch
rabbitair
rachio
radarr
radio_browser
radiotherm
rainbird
rainforest_eagle
rainforest_raven
rainmachine
random
rapt_ble
raspberry_pi
rdw
recollect_waste
recorder
recovery_mode
reddit
refoss
remember_the_milk
remote
renault
renson
reolink
repairs
rest
rest_command
rflink
rfxtrx
rhasspy
ridwell
ring
risco
rituals_perfume_genie
rmvtransport
roborock
roku
romy
roomba
roon
rova
rpi_power
rss_feed_template
rtsp_to_webrtc
ruckus_unleashed
ruuvi_gateway
ruuvitag_ble
rympro
sabnzbd
samsungtv
sanix
scene
schedule
schlage
scrape
screenlogic
script
search
season
select
sense
sensibo
sensirion_ble
sensor
sensorpro
sensorpush
sentry
senz
seventeentrack
sfr_box
sharkiq
shell_command
shelly
shopping_list
sia
sigfox
sighthound
signal_messenger
simplepush
simplisafe
simulated
siren
skybell
slack
sleepiq
slimproto
sma
smappee
smart_meter_texas
smartthings
smarttub
smhi
sms
smtp
snapcast
snips
snmp
snooz
solaredge
solarlog
solax
soma
somfy_mylink
sonarr
songpal
sonos
soundtouch
spaceapi
spc
speedtestdotnet
spider
spotify
sql
squeezebox
srp_energy
ssdp
starline
starlink
startca
statistics
statsd
steam_online
steamist
stookalert
stookwijzer
stream
streamlabswater
stt
subaru
suez_water
sun
sunweg
surepetcare
swiss_public_transport
switch
switch_as_x
switchbee
switchbot
switchbot_cloud
switcher_kis
syncthing
syncthru
synology_dsm
system_bridge
system_health
system_log
systemmonitor
tado
tag
tailscale
tailwind
tami4
tankerkoenig
tasmota
tautulli
tcp
technove
tedee
telegram
telegram_bot
tellduslive
temper
template
tesla_wall_connector
teslemetry
tessie
text
thermobeacon
thermopro
thread
threshold
tibber
tile
tilt_ble
time
time_date
timer
tod
todo
todoist
tolo
tomato
tomorrowio
toon
totalconnect
tplink
tplink_omada
traccar
traccar_server
trace
tractive
tradfri
trafikverket_camera
trafikverket_ferry
trafikverket_train
trafikverket_weatherstation
transmission
transport_nsw
trend
tts
tuya
twentemilieu
twilio
twinkly
twitch
uk_transport
ukraine_alarm
unifi
unifiprotect
universal
upb
upcloud
update
upnp
uptime
uptimerobot
usb
usgs_earthquakes_feed
utility_meter
uvc
v2c
vacuum
vallox
valve
velbus
velux
venstar
vera
verisure
version
vesync
vicare
vilfo
vizio
vlc_telnet
vodafone_station
voicerss
voip
volumio
volvooncall
vulcan
vultr
wake_on_lan
wake_word
wallbox
waqi
water_heater
watttime
waze_travel_time
weather
weatherflow
weatherflow_cloud
weatherkit
webhook
webmin
webostv
websocket_api
wemo
whirlpool
whois
wiffi
wilight
withings
wiz
wled
wolflink
workday
worldclock
ws66i
wsdot
wyoming
xbox
xiaomi
xiaomi_aqara
xiaomi_ble
xiaomi_miio
yale_smart_alarm
yalexs_ble
yamaha
yamaha_musiccast
yandex_transport
yandextts
yardian
yeelight
yolink
youless
youtube
zamg
zeroconf
zerproc
zeversolar
zha
zodiac
zone
zwave_js
zwave_me
__init__.py
conftest.py
fixtures
hassfest
helpers
non_packaged_scripts
pylint
resources
script
scripts
snapshots
test_util
testing_config
util
__init__.py
common.py
conftest.py
ignore_uncaught_exceptions.py
patch_time.py
ruff.toml
syrupy.py
test_backports.py
test_block_async_io.py
test_bootstrap.py
test_circular_imports.py
test_config.py
test_config_entries.py
test_const.py
test_core.py
test_data_entry_flow.py
test_exceptions.py
test_loader.py
test_main.py
test_requirements.py
test_runner.py
test_setup.py
test_test_fixtures.py
typing.py
.core_files.yaml
.coveragerc
.dockerignore
.git-blame-ignore-revs
.gitattributes
.gitignore
.hadolint.yaml
.pre-commit-config.yaml
.prettierignore
.strict-typing
.yamllint
CLA.md
CODEOWNERS
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Dockerfile
Dockerfile.dev
LICENSE.md
MANIFEST.in
README.rst
build.yaml
codecov.yml
mypy.ini
pyproject.toml
requirements.txt
requirements_all.txt
requirements_test.txt
requirements_test_all.txt
requirements_test_pre_commit.txt
core/tests/components/flux_led/test_select.py

326 lines
11 KiB
Python

"""Tests for select platform."""
from unittest.mock import patch
from flux_led.const import (
COLOR_MODE_CCT as FLUX_COLOR_MODE_CCT,
COLOR_MODE_RGBW as FLUX_COLOR_MODE_RGBW,
WhiteChannelType,
)
from flux_led.protocol import PowerRestoreState, RemoteConfig
import pytest
from homeassistant.components import flux_led
from homeassistant.components.flux_led.const import CONF_WHITE_CHANNEL_TYPE, DOMAIN
from homeassistant.components.select import DOMAIN as SELECT_DOMAIN
from homeassistant.const import ATTR_ENTITY_ID, ATTR_OPTION, CONF_HOST, CONF_NAME
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ServiceValidationError
from homeassistant.helpers import entity_registry as er
from homeassistant.setup import async_setup_component
from . import (
DEFAULT_ENTRY_TITLE,
FLUX_DISCOVERY,
IP_ADDRESS,
MAC_ADDRESS,
_mock_config_entry_for_bulb,
_mocked_bulb,
_mocked_switch,
_patch_discovery,
_patch_wifibulb,
)
from tests.common import MockConfigEntry
@pytest.fixture(autouse=True)
def no_wait_on_state_change():
"""Disable waiting for state change in tests."""
with patch("homeassistant.components.flux_led.select.STATE_CHANGE_LATENCY", 0):
yield
async def test_switch_power_restore_state(hass: HomeAssistant) -> None:
"""Test a smart plug power restore state."""
config_entry = MockConfigEntry(
domain=DOMAIN,
data={CONF_HOST: IP_ADDRESS, CONF_NAME: DEFAULT_ENTRY_TITLE},
unique_id=MAC_ADDRESS,
)
config_entry.add_to_hass(hass)
switch = _mocked_switch()
with _patch_discovery(), _patch_wifibulb(device=switch):
await async_setup_component(hass, flux_led.DOMAIN, {flux_led.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "select.bulb_rgbcw_ddeeff_power_restored"
state = hass.states.get(entity_id)
assert state.state == "Last State"
await hass.services.async_call(
SELECT_DOMAIN,
"select_option",
{ATTR_ENTITY_ID: entity_id, ATTR_OPTION: "Always On"},
blocking=True,
)
switch.async_set_power_restore.assert_called_once_with(
channel1=PowerRestoreState.ALWAYS_ON
)
async def test_power_restored_unique_id(
hass: HomeAssistant, entity_registry: er.EntityRegistry
) -> None:
"""Test a select unique id."""
config_entry = MockConfigEntry(
domain=DOMAIN,
data={CONF_HOST: IP_ADDRESS, CONF_NAME: DEFAULT_ENTRY_TITLE},
unique_id=MAC_ADDRESS,
)
config_entry.add_to_hass(hass)
switch = _mocked_switch()
with _patch_discovery(), _patch_wifibulb(device=switch):
await async_setup_component(hass, flux_led.DOMAIN, {flux_led.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "select.bulb_rgbcw_ddeeff_power_restored"
assert (
entity_registry.async_get(entity_id).unique_id
== f"{MAC_ADDRESS}_power_restored"
)
async def test_power_restored_unique_id_no_discovery(
hass: HomeAssistant, entity_registry: er.EntityRegistry
) -> None:
"""Test a select unique id."""
config_entry = MockConfigEntry(
domain=DOMAIN,
data={CONF_HOST: IP_ADDRESS, CONF_NAME: DEFAULT_ENTRY_TITLE},
)
config_entry.add_to_hass(hass)
switch = _mocked_switch()
with _patch_discovery(no_device=True), _patch_wifibulb(device=switch):
await async_setup_component(hass, flux_led.DOMAIN, {flux_led.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "select.bulb_rgbcw_ddeeff_power_restored"
assert (
entity_registry.async_get(entity_id).unique_id
== f"{config_entry.entry_id}_power_restored"
)
async def test_select_addressable_strip_config(hass: HomeAssistant) -> None:
"""Test selecting addressable strip configs."""
config_entry = MockConfigEntry(
domain=DOMAIN,
data={CONF_HOST: IP_ADDRESS, CONF_NAME: DEFAULT_ENTRY_TITLE},
unique_id=MAC_ADDRESS,
)
config_entry.add_to_hass(hass)
bulb = _mocked_bulb()
bulb.raw_state = bulb.raw_state._replace(model_num=0xA2) # addressable model
with _patch_discovery(), _patch_wifibulb(device=bulb):
await async_setup_component(hass, flux_led.DOMAIN, {flux_led.DOMAIN: {}})
await hass.async_block_till_done()
wiring_entity_id = "select.bulb_rgbcw_ddeeff_wiring"
state = hass.states.get(wiring_entity_id)
assert state.state == "BGRW"
ic_type_entity_id = "select.bulb_rgbcw_ddeeff_ic_type"
state = hass.states.get(ic_type_entity_id)
assert state.state == "WS2812B"
with pytest.raises(ServiceValidationError):
await hass.services.async_call(
SELECT_DOMAIN,
"select_option",
{ATTR_ENTITY_ID: wiring_entity_id, ATTR_OPTION: "INVALID"},
blocking=True,
)
await hass.services.async_call(
SELECT_DOMAIN,
"select_option",
{ATTR_ENTITY_ID: wiring_entity_id, ATTR_OPTION: "GRBW"},
blocking=True,
)
bulb.async_set_device_config.assert_called_once_with(wiring="GRBW")
bulb.async_set_device_config.reset_mock()
with pytest.raises(ServiceValidationError):
await hass.services.async_call(
SELECT_DOMAIN,
"select_option",
{ATTR_ENTITY_ID: ic_type_entity_id, ATTR_OPTION: "INVALID"},
blocking=True,
)
with patch(
"homeassistant.components.flux_led.async_setup_entry"
) as mock_setup_entry:
await hass.services.async_call(
SELECT_DOMAIN,
"select_option",
{ATTR_ENTITY_ID: ic_type_entity_id, ATTR_OPTION: "UCS1618"},
blocking=True,
)
await hass.async_block_till_done()
bulb.async_set_device_config.assert_called_once_with(ic_type="UCS1618")
assert len(mock_setup_entry.mock_calls) == 1
async def test_select_mutable_0x25_strip_config(hass: HomeAssistant) -> None:
"""Test selecting mutable 0x25 strip configs."""
config_entry = MockConfigEntry(
domain=DOMAIN,
data={CONF_HOST: IP_ADDRESS, CONF_NAME: DEFAULT_ENTRY_TITLE},
unique_id=MAC_ADDRESS,
)
config_entry.add_to_hass(hass)
bulb = _mocked_bulb()
bulb.operating_mode = "RGBWW"
bulb.operating_modes = ["DIM", "CCT", "RGB", "RGBW", "RGBWW"]
bulb.raw_state = bulb.raw_state._replace(model_num=0x25) # addressable model
with _patch_discovery(), _patch_wifibulb(device=bulb):
await async_setup_component(hass, flux_led.DOMAIN, {flux_led.DOMAIN: {}})
await hass.async_block_till_done()
operating_mode_entity_id = "select.bulb_rgbcw_ddeeff_operating_mode"
state = hass.states.get(operating_mode_entity_id)
assert state.state == "RGBWW"
with pytest.raises(ServiceValidationError):
await hass.services.async_call(
SELECT_DOMAIN,
"select_option",
{ATTR_ENTITY_ID: operating_mode_entity_id, ATTR_OPTION: "INVALID"},
blocking=True,
)
with patch(
"homeassistant.components.flux_led.async_setup_entry"
) as mock_setup_entry:
await hass.services.async_call(
SELECT_DOMAIN,
"select_option",
{ATTR_ENTITY_ID: operating_mode_entity_id, ATTR_OPTION: "CCT"},
blocking=True,
)
await hass.async_block_till_done()
bulb.async_set_device_config.assert_called_once_with(operating_mode="CCT")
assert len(mock_setup_entry.mock_calls) == 1
async def test_select_24ghz_remote_config(hass: HomeAssistant) -> None:
"""Test selecting 2.4ghz remote config."""
_mock_config_entry_for_bulb(hass)
bulb = _mocked_bulb()
bulb.discovery = FLUX_DISCOVERY
with _patch_discovery(device=FLUX_DISCOVERY), _patch_wifibulb(device=bulb):
await async_setup_component(hass, flux_led.DOMAIN, {flux_led.DOMAIN: {}})
await hass.async_block_till_done()
remote_config_entity_id = "select.bulb_rgbcw_ddeeff_remote_config"
state = hass.states.get(remote_config_entity_id)
assert state.state == "Open"
with pytest.raises(ServiceValidationError):
await hass.services.async_call(
SELECT_DOMAIN,
"select_option",
{ATTR_ENTITY_ID: remote_config_entity_id, ATTR_OPTION: "INVALID"},
blocking=True,
)
bulb.remote_config = RemoteConfig.DISABLED
await hass.services.async_call(
SELECT_DOMAIN,
"select_option",
{ATTR_ENTITY_ID: remote_config_entity_id, ATTR_OPTION: "Disabled"},
blocking=True,
)
bulb.async_config_remotes.assert_called_once_with(RemoteConfig.DISABLED)
bulb.async_config_remotes.reset_mock()
bulb.remote_config = RemoteConfig.PAIRED_ONLY
await hass.services.async_call(
SELECT_DOMAIN,
"select_option",
{ATTR_ENTITY_ID: remote_config_entity_id, ATTR_OPTION: "Paired Only"},
blocking=True,
)
bulb.async_config_remotes.assert_called_once_with(RemoteConfig.PAIRED_ONLY)
bulb.async_config_remotes.reset_mock()
async def test_select_white_channel_type(hass: HomeAssistant) -> None:
"""Test selecting the white channel type."""
config_entry = MockConfigEntry(
domain=DOMAIN,
data={CONF_HOST: IP_ADDRESS, CONF_NAME: DEFAULT_ENTRY_TITLE},
unique_id=MAC_ADDRESS,
)
config_entry.add_to_hass(hass)
bulb = _mocked_bulb()
bulb.color_modes = {FLUX_COLOR_MODE_RGBW, FLUX_COLOR_MODE_CCT}
bulb.color_mode = FLUX_COLOR_MODE_RGBW
bulb.raw_state = bulb.raw_state._replace(model_num=0x06) # rgbw
with _patch_discovery(), _patch_wifibulb(device=bulb):
await async_setup_component(hass, flux_led.DOMAIN, {flux_led.DOMAIN: {}})
await hass.async_block_till_done()
operating_mode_entity_id = "select.bulb_rgbcw_ddeeff_white_channel"
state = hass.states.get(operating_mode_entity_id)
assert state.state == WhiteChannelType.WARM.name.title()
with pytest.raises(ServiceValidationError):
await hass.services.async_call(
SELECT_DOMAIN,
"select_option",
{ATTR_ENTITY_ID: operating_mode_entity_id, ATTR_OPTION: "INVALID"},
blocking=True,
)
with patch(
"homeassistant.components.flux_led.async_setup_entry"
) as mock_setup_entry:
await hass.services.async_call(
SELECT_DOMAIN,
"select_option",
{
ATTR_ENTITY_ID: operating_mode_entity_id,
ATTR_OPTION: WhiteChannelType.NATURAL.name.title(),
},
blocking=True,
)
await hass.async_block_till_done()
assert (
config_entry.data[CONF_WHITE_CHANNEL_TYPE]
== WhiteChannelType.NATURAL.name.lower()
)
assert len(mock_setup_entry.mock_calls) == 1
async def test_select_device_no_wiring(hass: HomeAssistant) -> None:
"""Test select is not created if the device does not support wiring."""
config_entry = MockConfigEntry(
domain=DOMAIN,
data={CONF_HOST: IP_ADDRESS, CONF_NAME: DEFAULT_ENTRY_TITLE},
unique_id=MAC_ADDRESS,
)
config_entry.add_to_hass(hass)
bulb = _mocked_bulb()
bulb.wiring = None
bulb.wirings = ["RGB", "GRB"]
bulb.raw_state = bulb.raw_state._replace(model_num=0x25)
with _patch_discovery(), _patch_wifibulb(device=bulb):
await async_setup_component(hass, flux_led.DOMAIN, {flux_led.DOMAIN: {}})
await hass.async_block_till_done()
wiring_entity_id = "select.bulb_rgbcw_ddeeff_wiring"
assert hass.states.get(wiring_entity_id) is None