Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.switch.SwitchEntity Class Reference

Inherits homeassistant.helpers.entity.ToggleEntity, cached_properties, and CACHED_PROPERTIES_WITH_ATTR_.

Inherited by homeassistant.components.abode.switch.AbodeAutomationSwitch, homeassistant.components.abode.switch.AbodeSwitch, homeassistant.components.acer_projector.switch.AcerSwitch, homeassistant.components.adguard.switch.AdGuardHomeSwitch, homeassistant.components.ads.switch.AdsSwitch, homeassistant.components.advantage_air.switch.AdvantageAirFreshAir, homeassistant.components.advantage_air.switch.AdvantageAirMyFan, homeassistant.components.advantage_air.switch.AdvantageAirRelay, homeassistant.components.airgradient.switch.AirGradientSwitch, homeassistant.components.airzone.switch.AirzoneBaseSwitch, homeassistant.components.airzone_cloud.switch.AirzoneBaseSwitch, homeassistant.components.amcrest.switch.AmcrestSwitch, homeassistant.components.android_ip_webcam.switch.IPWebcamSettingSwitch, homeassistant.components.anel_pwrctrl.switch.PwrCtrlSwitch, homeassistant.components.apsystems.switch.ApSystemsInverterSwitch, homeassistant.components.aqualogic.switch.AquaLogicSwitch, homeassistant.components.arest.switch.ArestSwitchBase, homeassistant.components.aten_pe.switch.AtenSwitch, homeassistant.components.axis.switch.AxisSwitch, homeassistant.components.baf.switch.BAFSwitch, homeassistant.components.blebox.switch.BleBoxSwitchEntity, homeassistant.components.blink.switch.BlinkSwitch, homeassistant.components.bmw_connected_drive.switch.BMWSwitch, homeassistant.components.bond.switch.BondSwitch, homeassistant.components.bosch_shc.switch.SHCRoutingSwitch, homeassistant.components.bosch_shc.switch.SHCSwitch, homeassistant.components.broadlink.switch.BroadlinkSwitch, homeassistant.components.cambridge_audio.switch.CambridgeAudioSwitch, homeassistant.components.chacon_dio.switch.ChaconDioSwitch, homeassistant.components.comelit.switch.ComelitSwitchEntity, homeassistant.components.command_line.switch.CommandSwitch, homeassistant.components.daikin.switch.DaikinStreamerSwitch, homeassistant.components.daikin.switch.DaikinToggleSwitch, homeassistant.components.daikin.switch.DaikinZoneSwitch, homeassistant.components.danfoss_air.switch.DanfossAir, homeassistant.components.deluge.switch.DelugeSwitch, homeassistant.components.demo.switch.DemoSwitch, homeassistant.components.devolo_home_control.switch.DevoloSwitch, homeassistant.components.digital_ocean.switch.DigitalOceanSwitch, homeassistant.components.dlink.switch.SmartPlugSwitch, homeassistant.components.drop_connect.switch.DROPSwitch, homeassistant.components.duotecno.switch.DuotecnoSwitch, homeassistant.components.dynalite.switch.DynaliteSwitch, homeassistant.components.ecoal_boiler.switch.EcoalSwitch, homeassistant.components.ecobee.switch.EcobeeSwitchAuxHeatOnly, homeassistant.components.ecobee.switch.EcobeeVentilator20MinSwitch, homeassistant.components.ecoforest.switch.EcoforestSwitchEntity, homeassistant.components.econet.switch.EcoNetSwitchAuxHeatOnly, homeassistant.components.ecovacs.switch.EcovacsSwitchEntity, homeassistant.components.edimax.switch.SmartPlugSwitch, homeassistant.components.elgato.switch.ElgatoSwitchEntity, homeassistant.components.elkm1.switch.ElkOutput, homeassistant.components.elkm1.switch.ElkThermostatEMHeat, homeassistant.components.elmax.switch.ElmaxSwitch, homeassistant.components.elv.switch.SmartPlugSwitch, homeassistant.components.energenie_power_sockets.switch.EGPowerStripSocket, homeassistant.components.enocean.switch.EnOceanSwitch, homeassistant.components.enphase_envoy.switch.EnvoyDryContactSwitchEntity, homeassistant.components.enphase_envoy.switch.EnvoyEnpowerSwitchEntity, homeassistant.components.enphase_envoy.switch.EnvoyStorageSettingsSwitchEntity, homeassistant.components.envisalink.switch.EnvisalinkSwitch, homeassistant.components.eq3btsmart.switch.Eq3SwitchEntity, homeassistant.components.esphome.switch.EsphomeSwitch, homeassistant.components.eufy.switch.EufyHomeSwitch, homeassistant.components.ezviz.switch.EzvizSwitch, homeassistant.components.fibaro.switch.FibaroSwitch, homeassistant.components.fireservicerota.switch.ResponseSwitch, homeassistant.components.firmata.switch.FirmataSwitch, homeassistant.components.flexit_bacnet.switch.FlexitSwitch, homeassistant.components.flipr.switch.FliprHubSwitch, homeassistant.components.flo.switch.FloSwitch, homeassistant.components.flux_led.switch.FluxMusicSwitch, homeassistant.components.flux_led.switch.FluxRemoteAccessSwitch, homeassistant.components.flux_led.switch.FluxSwitch, homeassistant.components.foscam.switch.FoscamSleepSwitch, homeassistant.components.freebox.switch.FreeboxSwitch, homeassistant.components.freedompro.switch.Device, homeassistant.components.fritz.switch.FritzBoxBaseCoordinatorSwitch, homeassistant.components.fritz.switch.FritzBoxBaseSwitch, homeassistant.components.fritz.switch.FritzBoxProfileSwitch, homeassistant.components.fritzbox.switch.FritzboxSwitch, homeassistant.components.fully_kiosk.switch.FullySwitchEntity, homeassistant.components.gardena_bluetooth.switch.GardenaBluetoothValveSwitch, homeassistant.components.gc100.switch.GC100Switch, homeassistant.components.geniushub.switch.GeniusSwitch, homeassistant.components.goalzero.switch.GoalZeroSwitch, homeassistant.components.gree.switch.GreeSwitch, homeassistant.components.group.switch.SwitchGroup, homeassistant.components.guardian.switch.ValveControllerSwitch, homeassistant.components.habitica.switch.HabiticaSwitch, homeassistant.components.hikvisioncam.switch.HikvisionMotionSwitch, homeassistant.components.hive.switch.HiveSwitch, homeassistant.components.hlk_sw16.switch.SW16Switch, homeassistant.components.home_connect.switch.HomeConnectPowerSwitch, homeassistant.components.home_connect.switch.HomeConnectProgramSwitch, homeassistant.components.home_connect.switch.HomeConnectSwitch, homeassistant.components.homekit_controller.switch.DeclarativeCharacteristicSwitch, homeassistant.components.homekit_controller.switch.HomeKitFaucet, homeassistant.components.homekit_controller.switch.HomeKitSwitch, homeassistant.components.homekit_controller.switch.HomeKitValve, homeassistant.components.homematic.switch.HMSwitch, homeassistant.components.homematicip_cloud.switch.HomematicipGroupSwitch, homeassistant.components.homematicip_cloud.switch.HomematicipMultiSwitch, homeassistant.components.homematicip_cloud.switch.HomematicipSwitch, homeassistant.components.homewizard.switch.HomeWizardSwitchEntity, homeassistant.components.honeywell.switch.HoneywellSwitch, homeassistant.components.huawei_lte.switch.HuaweiLteBaseSwitch, homeassistant.components.hue.switch.HueResourceEnabledEntity, homeassistant.components.husqvarna_automower.switch.AutomowerScheduleSwitchEntity, homeassistant.components.husqvarna_automower.switch.StayOutZoneSwitchEntity, homeassistant.components.husqvarna_automower.switch.WorkAreaSwitchEntity, homeassistant.components.hydrawise.switch.HydrawiseSwitch, homeassistant.components.hyperion.switch.HyperionComponentSwitch, homeassistant.components.ihc.switch.IHCSwitch, homeassistant.components.insteon.switch.InsteonSwitchEntity, homeassistant.components.intellifire.switch.IntellifireSwitch, homeassistant.components.iotty.switch.IottyLightSwitch, homeassistant.components.isy994.switch.ISYEnableSwitchEntity, homeassistant.components.isy994.switch.ISYSwitchEntity, homeassistant.components.isy994.switch.ISYSwitchProgramEntity, homeassistant.components.juicenet.switch.JuiceNetChargeNowSwitch, homeassistant.components.kankun.switch.KankunSwitch, homeassistant.components.keymitt_ble.switch.MicroBotBinarySwitch, homeassistant.components.kitchen_sink.switch.DemoSwitch, homeassistant.components.kmtronic.switch.KMtronicSwitch, homeassistant.components.knx.switch._KnxSwitch, homeassistant.components.konnected.switch.KonnectedSwitch, homeassistant.components.kostal_plenticore.switch.PlenticoreDataSwitch, homeassistant.components.lamarzocco.switch.LaMarzoccoAutoOnOffSwitchEntity, homeassistant.components.lamarzocco.switch.LaMarzoccoSwitchEntity, homeassistant.components.lametric.switch.LaMetricSwitchEntity, homeassistant.components.lektrico.switch.LektricoSwitch, homeassistant.components.lg_thinq.switch.ThinQSwitchEntity, homeassistant.components.lightwave.switch.LWRFSwitch, homeassistant.components.linode.switch.LinodeSwitch, homeassistant.components.litejet.switch.LiteJetSwitch, homeassistant.components.litterrobot.switch.RobotSwitchEntity, homeassistant.components.livisi.switch.LivisiSwitch, homeassistant.components.lupusec.switch.LupusecSwitch, homeassistant.components.lutron.switch.LutronLed, homeassistant.components.lutron.switch.LutronSwitch, homeassistant.components.matter.switch.MatterSwitch, homeassistant.components.melnor.switch.MelnorZoneSwitch, homeassistant.components.mfi.switch.MfiSwitch, homeassistant.components.microbees.switch.MBSwitch, homeassistant.components.mochad.switch.MochadSwitch, homeassistant.components.modbus.switch.ModbusSwitch, homeassistant.components.modern_forms.switch.ModernFormsSwitch, homeassistant.components.motioneye.switch.MotionEyeSwitch, homeassistant.components.mqtt.switch.MqttSwitch, homeassistant.components.mysensors.switch.MySensorsSwitch, homeassistant.components.mystrom.switch.MyStromSwitch, homeassistant.components.myuplink.switch.MyUplinkDevicePointSwitch, homeassistant.components.neato.switch.NeatoConnectedSwitch, homeassistant.components.netatmo.switch.NetatmoSwitch, homeassistant.components.netgear.switch.NetgearAllowBlock, homeassistant.components.netgear.switch.NetgearRouterSwitchEntity, homeassistant.components.netio.switch.NetioSwitch, homeassistant.components.nexia.switch.NexiaEmergencyHeatSwitch, homeassistant.components.nexia.switch.NexiaHoldSwitch, homeassistant.components.nextdns.switch.NextDnsSwitch, homeassistant.components.nibe_heatpump.switch.Switch, homeassistant.components.nice_go.switch.NiceGOSwitchEntity, homeassistant.components.nissan_leaf.switch.LeafClimateSwitch, homeassistant.components.numato.switch.NumatoGpioSwitch, homeassistant.components.nzbget.switch.NZBGetDownloadSwitch, homeassistant.components.omnilogic.switch.OmniLogicSwitch, homeassistant.components.onewire.switch.OneWireSwitch, homeassistant.components.onvif.switch.ONVIFSwitch, homeassistant.components.opentherm_gw.switch.OpenThermSwitch, homeassistant.components.orvibo.switch.S20Switch, homeassistant.components.overkiz.switch.OverkizSwitch, homeassistant.components.pencom.switch.PencomRelay, homeassistant.components.philips_js.switch.PhilipsTVAmbilightHueSwitch, homeassistant.components.philips_js.switch.PhilipsTVScreenSwitch, homeassistant.components.pi_hole.switch.PiHoleSwitch, homeassistant.components.pilight.switch.PilightSwitch, homeassistant.components.plugwise.switch.PlugwiseSwitchEntity, homeassistant.components.powerwall.switch.PowerwallOffGridEnabledEntity, homeassistant.components.progettihwsw.switch.ProgettihwswSwitch, homeassistant.components.pulseaudio_loopback.switch.PALoopbackSwitch, homeassistant.components.pyload.switch.PyLoadSwitchEntity, homeassistant.components.qbittorrent.switch.QBittorrentSwitch, homeassistant.components.qwikswitch.switch.QSSwitch, homeassistant.components.rachio.switch.RachioSwitch, homeassistant.components.rachio.switch.RachioValve, homeassistant.components.radiotherm.switch.RadioThermHoldSwitch, homeassistant.components.rainbird.switch.RainBirdSwitch, homeassistant.components.raincloud.switch.RainCloudSwitch, homeassistant.components.rainmachine.switch.RainMachineBaseSwitch, homeassistant.components.raspyrfm.switch.RaspyRFMSwitch, homeassistant.components.recswitch.switch.RecSwitchSwitch, homeassistant.components.refoss.switch.RefossSwitch, homeassistant.components.remote_rpi_gpio.switch.RemoteRPiGPIOSwitch, homeassistant.components.renson.switch.RensonBreezeSwitch, homeassistant.components.reolink.switch.ReolinkChimeSwitchEntity, homeassistant.components.reolink.switch.ReolinkNVRSwitchEntity, homeassistant.components.reolink.switch.ReolinkSwitchEntity, homeassistant.components.rest.switch.RestSwitch, homeassistant.components.rflink.switch.RflinkSwitch, homeassistant.components.rfxtrx.switch.RfxtrxSwitch, homeassistant.components.ridwell.switch.RidwellSwitch, homeassistant.components.ring.switch.RingSwitch, homeassistant.components.risco.switch.RiscoCloudSwitch, homeassistant.components.risco.switch.RiscoLocalSwitch, homeassistant.components.rituals_perfume_genie.switch.RitualsSwitchEntity, homeassistant.components.roborock.switch.RoborockSwitch, homeassistant.components.satel_integra.switch.SatelIntegraSwitch, homeassistant.components.schlage.switch.SchlageSwitch, homeassistant.components.screenlogic.switch.ScreenLogicCircuitSwitch, homeassistant.components.scsgate.switch.SCSGateSwitch, homeassistant.components.sensibo.switch.SensiboDeviceSwitch, homeassistant.components.shelly.switch.BlockRelaySwitch, homeassistant.components.shelly.switch.BlockSleepingMotionSwitch, homeassistant.components.shelly.switch.RpcRelaySwitch, homeassistant.components.shelly.switch.RpcScriptSwitch, homeassistant.components.shelly.switch.RpcVirtualSwitch, homeassistant.components.skybell.switch.SkybellSwitch, homeassistant.components.sleepiq.switch.SleepNumberPrivateSwitch, homeassistant.components.smappee.switch.SmappeeActuator, homeassistant.components.smartthings.switch.SmartThingsSwitch, homeassistant.components.smarttub.switch.SmartTubPump, homeassistant.components.smarty.switch.SmartySwitch, homeassistant.components.smlight.switch.SmSwitch, homeassistant.components.snmp.switch.SnmpSwitch, homeassistant.components.sonos.switch.SonosAlarmEntity, homeassistant.components.sonos.switch.SonosSwitchEntity, homeassistant.components.sony_projector.switch.SonyProjector, homeassistant.components.starline.switch.StarlineSwitch, homeassistant.components.starlink.switch.StarlinkSwitchEntity, homeassistant.components.steamist.switch.SteamistSwitchEntity, homeassistant.components.supla.switch.SuplaSwitchEntity, homeassistant.components.switchbot.switch.SwitchBotSwitch, homeassistant.components.switchbot_cloud.switch.SwitchBotCloudSwitch, homeassistant.components.switcher_kis.switch.SwitcherBaseSwitchEntity, homeassistant.components.switchmate.switch.SwitchmateEntity, homeassistant.components.synology_dsm.switch.SynoDSMSurveillanceHomeModeToggle, homeassistant.components.tasmota.switch.TasmotaSwitch, homeassistant.components.technove.switch.TechnoVESwitchEntity, homeassistant.components.tellduslive.switch.TelldusLiveSwitch, homeassistant.components.tellstick.switch.TellstickSwitch, homeassistant.components.telnet.switch.TelnetSwitch, homeassistant.components.template.switch.SwitchTemplate, homeassistant.components.tesla_fleet.switch.TeslaFleetSwitchEntity, homeassistant.components.teslemetry.switch.TeslemetrySwitchEntity, homeassistant.components.tessie.switch.TessieChargeFromGridSwitchEntity, homeassistant.components.tessie.switch.TessieStormModeSwitchEntity, homeassistant.components.tessie.switch.TessieSwitchEntity, homeassistant.components.thinkingcleaner.switch.ThinkingCleanerSwitch, homeassistant.components.tolo.switch.ToloSwitchEntity, homeassistant.components.toon.switch.ToonSwitch, homeassistant.components.tplink.switch.TPLinkSwitch, homeassistant.components.tplink_omada.switch.OmadaDevicePortSwitchEntity, homeassistant.components.tractive.switch.TractiveSwitch, homeassistant.components.tradfri.switch.TradfriSwitch, homeassistant.components.transmission.switch.TransmissionSwitch, homeassistant.components.triggercmd.switch.TRIGGERcmdSwitch, homeassistant.components.tuya.switch.TuyaSwitchEntity, homeassistant.components.unifi.switch.UnifiSwitchEntity, homeassistant.components.unifiprotect.switch.ProtectNVRSwitch, homeassistant.components.unifiprotect.switch.ProtectSwitch, homeassistant.components.upcloud.switch.UpCloudSwitch, homeassistant.components.uptimerobot.switch.UptimeRobotSwitch, homeassistant.components.v2c.switch.V2CSwitchEntity, homeassistant.components.vallox.switch.ValloxSwitchEntity, homeassistant.components.velbus.switch.VelbusSwitch, homeassistant.components.vera.switch.VeraSwitch, homeassistant.components.verisure.switch.VerisureSmartplug, homeassistant.components.versasense.switch.VActuator, homeassistant.components.vesync.switch.VeSyncBaseSwitch, homeassistant.components.vesync.switch.VeSyncLightSwitch, homeassistant.components.vesync.switch.VeSyncSwitchHA, homeassistant.components.voip.switch.VoIPCallAllowedSwitch, homeassistant.components.volvooncall.switch.VolvoSwitch, homeassistant.components.vultr.switch.VultrSwitch, homeassistant.components.wake_on_lan.switch.WolSwitch, homeassistant.components.wallbox.switch.WallboxSwitch, homeassistant.components.wemo.switch.WemoSwitch, homeassistant.components.wilight.switch.WiLightValvePauseSwitch, homeassistant.components.wilight.switch.WiLightValveSwitch, homeassistant.components.wirelesstag.switch.WirelessTagSwitch, homeassistant.components.wiz.switch.WizSocketEntity, homeassistant.components.wled.switch.WLEDNightlightSwitch, homeassistant.components.wled.switch.WLEDReverseSwitch, homeassistant.components.wled.switch.WLEDSyncReceiveSwitch, homeassistant.components.wled.switch.WLEDSyncSendSwitch, homeassistant.components.wyoming.switch.WyomingSatelliteMuteSwitch, homeassistant.components.xiaomi_aqara.switch.XiaomiGenericSwitch, homeassistant.components.xiaomi_miio.switch.XiaomiGatewaySwitch, homeassistant.components.xiaomi_miio.switch.XiaomiGenericCoordinatedSwitch, homeassistant.components.xiaomi_miio.switch.XiaomiPlugGenericSwitch, homeassistant.components.xs1.switch.XS1SwitchEntity, homeassistant.components.yale_smart_alarm.switch.YaleAutolockSwitch, homeassistant.components.yamaha_musiccast.switch.SwitchCapability, homeassistant.components.yardian.switch.YardianSwitch, homeassistant.components.yolink.switch.YoLinkSwitchEntity, homeassistant.components.zha.switch.Switch, homeassistant.components.zoneminder.switch.ZMSwitchMonitors, and homeassistant.components.zwave_me.switch.ZWaveMeSwitch.

Collaboration diagram for homeassistant.components.switch.SwitchEntity:
[legend]

Public Member Functions

SwitchDeviceClass|None device_class (self)
 
- Public Member Functions inherited from homeassistant.helpers.entity.ToggleEntity
None async_toggle (self, **Any kwargs)
 
None async_turn_off (self, **Any kwargs)
 
None async_turn_on (self, **Any kwargs)
 
bool|None is_on (self)
 
Literal["on", "off"]|None state (self)
 
None toggle (self, **Any kwargs)
 
None turn_off (self, **Any kwargs)
 
None turn_on (self, **Any kwargs)
 
- Public Member Functions inherited from homeassistant.helpers.entity.Entity
None __init_subclass__ (cls, **Any kwargs)
 
str __repr__ (self)
 
None add_to_platform_abort (self)
 
None add_to_platform_finish (self)
 
None add_to_platform_start (self, HomeAssistant hass, EntityPlatform platform, asyncio.Semaphore|None parallel_updates)
 
bool assumed_state (self)
 
None async_added_to_hass (self)
 
None async_device_update (self, bool warning=True)
 
None async_internal_added_to_hass (self)
 
None async_internal_will_remove_from_hass (self)
 
None async_on_remove (self, CALLBACK_TYPE func)
 
None async_registry_entry_updated (self)
 
None async_remove (self, *bool force_remove=False)
 
None async_removed_from_registry (self)
 
None async_schedule_update_ha_state (self, bool force_refresh=False)
 
None async_set_context (self, Context context)
 
None async_update_ha_state (self, bool force_refresh=False)
 
None async_will_remove_from_hass (self)
 
None async_write_ha_state (self)
 
str|None attribution (self)
 
bool available (self)
 
dict[str, Any]|None capability_attributes (self)
 
DeviceInfo|None device_info (self)
 
bool enabled (self)
 
EntityCategory|None entity_category (self)
 
str|None entity_picture (self)
 
bool entity_registry_enabled_default (self)
 
bool entity_registry_visible_default (self)
 
Mapping[str, Any]|None extra_state_attributes (self)
 
bool force_update (self)
 
HassJobType get_hassjob_type (self, str function_name)
 
er.EntityOptionsType|None get_initial_entity_options (self)
 
bool has_entity_name (self)
 
str|None icon (self)
 
str|UndefinedType|None name (self)
 
None schedule_update_ha_state (self, bool force_refresh=False)
 
bool should_poll (self)
 
dict[str, Any]|None state_attributes (self)
 
str|None suggested_object_id (self)
 
int|None supported_features (self)
 
str|None translation_key (self)
 
Mapping[str, strtranslation_placeholders (self)
 
str|None unique_id (self)
 
str|None unit_of_measurement (self)
 
bool use_device_name (self)
 
- Public Member Functions inherited from homeassistant.helpers.entity.CachedProperties
None __init__ (cls, str name, tuple[type,...] bases, dict[Any, Any] namespace, **Any kwargs)
 
Any __new__ (mcs, str name, tuple[type,...] bases, dict[Any, Any] namespace, set[str]|None cached_properties=None, **Any kwargs)
 

Additional Inherited Members

- Public Attributes inherited from homeassistant.helpers.entity.Entity
 device_entry
 
 entity_id
 
 hass
 
 parallel_updates
 
 platform
 
 registry_entry
 
- Static Public Attributes inherited from homeassistant.helpers.entity.ToggleEntity
 None
 
- Static Public Attributes inherited from homeassistant.helpers.entity.Entity
 bool
 
 EntityPlatform
 
 HomeAssistant
 
 None
 
 StateInfo
 
 StateType
 
 str
 

Detailed Description

Base class for switch entities.

Definition at line 113 of file __init__.py.

Member Function Documentation

◆ device_class()

SwitchDeviceClass | None homeassistant.components.switch.SwitchEntity.device_class (   self)
Return the class of this entity.

Reimplemented from homeassistant.helpers.entity.Entity.

Reimplemented in homeassistant.components.geniushub.switch.GeniusSwitch.

Definition at line 120 of file __init__.py.


The documentation for this class was generated from the following file: