mirror of
https://github.com/home-assistant/core.git
synced 2025-08-11 06:20:01 +00:00
.github
docs
homeassistant
auth
components
ads
air_quality
alarm_control_panel
alexa
auth
automation
axis
binary_sensor
__init__.py
abode.py
ads.py
alarmdecoder.py
android_ip_webcam.py
apcupsd.py
arest.py
august.py
aurora.py
axis.py
bayesian.py
bbb_gpio.py
blink.py
bloomsky.py
bmw_connected_drive.py
command_line.py
concord232.py
deconz.py
demo.py
digital_ocean.py
ecobee.py
egardia.py
eight_sleep.py
enocean.py
envisalink.py
esphome.py
ffmpeg_motion.py
ffmpeg_noise.py
fibaro.py
flic.py
fritzbox.py
gc100.py
hikvision.py
hive.py
homematic.py
homematicip_cloud.py
hydrawise.py
ihc.py
insteon.py
iss.py
isy994.py
knx.py
konnected.py
linode.py
lupusec.py
maxcube.py
modbus.py
mqtt.py
mychevy.py
mysensors.py
mystrom.py
ness_alarm.py
nest.py
netatmo.py
nx584.py
octoprint.py
opentherm_gw.py
openuv.py
pilight.py
ping.py
point.py
qwikswitch.py
rachio.py
raincloud.py
rainmachine.py
random.py
raspihats.py
rest.py
rflink.py
rfxtrx.py
ring.py
rpi_gpio.py
rpi_pfio.py
satel_integra.py
sense.py
skybell.py
sleepiq.py
spc.py
tahoma.py
tapsaff.py
tcp.py
tellduslive.py
template.py
tesla.py
threshold.py
trend.py
upcloud.py
uptimerobot.py
velbus.py
vera.py
verisure.py
volvooncall.py
vultr.py
w800rf32.py
wemo.py
wink.py
wirelesstag.py
workday.py
xiaomi_aqara.py
zha.py
zigbee.py
zwave.py
blink
bmw_connected_drive
calendar
camera
cast
climate
cloud
config
conversation
counter
cover
daikin
deconz
device_tracker
dialogflow
elkm1
emulated_hue
envisalink
esphome
fan
frontend
geo_location
geofency
google_assistant
group
habitica
hangouts
hassio
homekit
homekit_controller
homematic
homematicip_cloud
http
hue
ifttt
ihc
image_processing
insteon
ios
lifx
light
lock
lovelace
luftdaten
mailbox
mailgun
media_player
mqtt
mysensors
nest
notify
onboarding
opentherm_gw
openuv
owntracks
persistent_notification
point
rainmachine
recorder
remember_the_milk
remote
scene
sensor
simplisafe
smhi
sonos
switch
system_log
telegram_bot
tellduslive
tibber
timer
tradfri
tts
twilio
unifi
upnp
vacuum
water_heater
weather
websocket_api
wink
wunderlist
zha
zone
zoneminder
zwave
__init__.py
abode.py
alarmdecoder.py
alert.py
amcrest.py
android_ip_webcam.py
apcupsd.py
api.py
apple_tv.py
aqualogic.py
arduino.py
arlo.py
asterisk_mbox.py
asuswrt.py
august.py
bbb_gpio.py
bloomsky.py
browser.py
canary.py
cloudflare.py
coinbase.py
comfoconnect.py
configurator.py
datadog.py
demo.py
device_sun_light_trigger.py
digital_ocean.py
discovery.py
dominos.py
doorbird.py
downloader.py
duckdns.py
dweet.py
dyson.py
ecobee.py
ecovacs.py
edp_redy.py
egardia.py
eight_sleep.py
emoncms_history.py
enocean.py
eufy.py
evohome.py
feedreader.py
ffmpeg.py
fibaro.py
folder_watcher.py
foursquare.py
freebox.py
freedns.py
fritzbox.py
gc100.py
goalfeed.py
google.py
google_domains.py
graphite.py
greeneye_monitor.py
hdmi_cec.py
history.py
history_graph.py
hive.py
hlk_sw16.py
homeworks.py
huawei_lte.py
hydrawise.py
idteck_prox.py
influxdb.py
input_boolean.py
input_datetime.py
input_number.py
input_select.py
input_text.py
insteon_local.py
insteon_plm.py
intent_script.py
introduction.py
iota.py
isy994.py
joaoapps_join.py
juicenet.py
keyboard.py
keyboard_remote.py
kira.py
knx.py
konnected.py
lametric.py
lcn.py
lightwave.py
linode.py
lirc.py
litejet.py
logbook.py
logentries.py
logger.py
logi_circle.py
lupusec.py
lutron.py
lutron_caseta.py
map.py
matrix.py
maxcube.py
media_extractor.py
melissa.py
microsoft_face.py
mochad.py
modbus.py
mqtt_eventstream.py
mqtt_statestream.py
mychevy.py
mycroft.py
mythicbeastsdns.py
namecheapdns.py
neato.py
ness_alarm.py
netatmo.py
netgear_lte.py
no_ip.py
nuheat.py
nuimo_controller.py
octoprint.py
panel_custom.py
panel_iframe.py
pilight.py
plant.py
plum_lightpad.py
prometheus.py
proximity.py
python_script.py
qwikswitch.py
rachio.py
rainbird.py
raincloud.py
raspihats.py
rest_command.py
rflink.py
rfxtrx.py
ring.py
route53.py
rpi_gpio.py
rpi_pfio.py
rss_feed_template.py
sabnzbd.py
satel_integra.py
script.py
scsgate.py
sense.py
services.yaml
shell_command.py
shiftr.py
shopping_list.py
sisyphus.py
skybell.py
sleepiq.py
smappee.py
snips.py
spaceapi.py
spc.py
spider.py
splunk.py
statsd.py
sun.py
tado.py
tahoma.py
tellstick.py
tesla.py
thethingsnetwork.py
thingspeak.py
toon.py
tplink_lte.py
tuya.py
upcloud.py
updater.py
usps.py
velbus.py
velux.py
vera.py
verisure.py
volvooncall.py
vultr.py
w800rf32.py
wake_on_lan.py
waterfurnace.py
watson_iot.py
webhook.py
weblink.py
wemo.py
wirelesstag.py
xiaomi_aqara.py
zabbix.py
zeroconf.py
zigbee.py
helpers
scripts
util
__init__.py
__main__.py
bootstrap.py
config.py
config_entries.py
const.py
core.py
data_entry_flow.py
exceptions.py
loader.py
monkey_patch.py
package_constraints.txt
requirements.py
setup.py
script
tests
virtualization
.coveragerc
.dockerignore
.gitattributes
.gitignore
.hound.yml
.ignore
.isort.cfg
.readthedocs.yml
.travis.yml
CLA.md
CODEOWNERS
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Dockerfile
LICENSE.md
MANIFEST.in
README.rst
mypy.ini
pylintrc
requirements_all.txt
requirements_docs.txt
requirements_test.txt
requirements_test_all.txt
setup.cfg
setup.py
tox.ini
39 lines
1.1 KiB
Python
39 lines
1.1 KiB
Python
"""
|
|
Support for monitoring the state of UpCloud servers.
|
|
|
|
For more details about this component, please refer to the documentation at
|
|
https://home-assistant.io/components/binary_sensor.upcloud/
|
|
"""
|
|
import logging
|
|
|
|
import voluptuous as vol
|
|
|
|
import homeassistant.helpers.config_validation as cv
|
|
from homeassistant.components.binary_sensor import (
|
|
BinarySensorDevice, PLATFORM_SCHEMA)
|
|
from homeassistant.components.upcloud import (
|
|
UpCloudServerEntity, CONF_SERVERS, DATA_UPCLOUD)
|
|
|
|
_LOGGER = logging.getLogger(__name__)
|
|
|
|
DEPENDENCIES = ['upcloud']
|
|
|
|
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
|
vol.Required(CONF_SERVERS): vol.All(cv.ensure_list, [cv.string]),
|
|
})
|
|
|
|
|
|
def setup_platform(hass, config, add_entities, discovery_info=None):
|
|
"""Set up the UpCloud server binary sensor."""
|
|
upcloud = hass.data[DATA_UPCLOUD]
|
|
|
|
servers = config.get(CONF_SERVERS)
|
|
|
|
devices = [UpCloudBinarySensor(upcloud, uuid) for uuid in servers]
|
|
|
|
add_entities(devices, True)
|
|
|
|
|
|
class UpCloudBinarySensor(UpCloudServerEntity, BinarySensorDevice):
|
|
"""Representation of an UpCloud server sensor."""
|