hass-core/homeassistant/components/light
Matthew Treinish 1f1115f631 Serialize mochad requests (#11029)
All mochad devices are sharing a single socket interface. When multiple
threads are issuing requests to the mochad daemon at the same time the
write read cycle might get crossed between the threads. This is normally
not an issue for 1-way X10 devices because as long as the request issued
successfully and data is read over the socket then we know as much as
mochad will tell us (since there is no ACK from the request for most
X10 devices). However, where it does matter is on the device __init__()
because we're relying on the mochad daemon's internal state to take an
educated guess at the device's state to intialize things with. When
there are multiple devices being initialized at the same time the wires
can get crossed between and the wrong device state may be read.

To address this potential issue this commit adds locking using a
semaphore around all pairs of send_cmd() and read_data() (which is what
pymochad.device.Device.get_status() does internally) calls to the mochad
controller to ensure we're only ever dealing with a single request at a
time.

Fixes mtreinish/pymochad#4
2017-12-08 09:18:52 -08:00
..
__init__.py Cleanup old stale restore feature (#10593) 2017-11-15 23:03:41 -08:00
abode.py Abode services, events, lights, cameras, automations, quick actions. (#9310) 2017-09-18 17:39:41 +02:00
ads.py Add ADS component (#10142) 2017-12-05 09:44:22 +01:00
avion.py Update avion.py (#8364) 2017-07-06 23:20:39 -07:00
blinksticklight.py Update docstrings and log messages (#7526) 2017-05-10 12:06:57 +02:00
blinkt.py Single LEDs in Blinkt support (#10581) 2017-11-27 21:14:03 +01:00
decora.py Decora: Fix set brightness and improve reconnection (#8522) 2017-07-19 00:02:42 +02:00
decora_wifi.py Fix #8960 - Decora Wi-Fi Switch unable to set brightness (#8989) 2017-08-15 16:12:16 +02:00
demo.py Cleanup old stale restore feature (#10593) 2017-11-15 23:03:41 -08:00
enocean.py Update docstrings and log messages (#7526) 2017-05-10 12:06:57 +02:00
flux_led.py flux led lib 0.20 (#9533) 2017-09-22 10:39:53 +02:00
hive.py New Hive Component / Platforms (#9804) 2017-11-23 13:10:23 +01:00
homematic.py WIP: Homematic improvments with new hass interfaces (#9058) 2017-08-31 21:16:44 +02:00
hue.py Fix name collision when using multiple Hue bridges (#10486) 2017-11-23 17:26:36 -08:00
hyperion.py Add priority attribute for hyperion (#10102) 2017-10-30 21:48:42 +01:00
insteon_local.py Refactored to new global json saving and loading (#10677) 2017-11-19 19:47:55 -08:00
insteon_plm.py Fix a bunch of typos (#9545) 2017-09-23 17:15:46 +02:00
isy994.py Change Error Message when Turning off ISY994 Light (#8131) 2017-06-21 09:38:12 +02:00
knx.py renamed add_devices to async_add_devices according to hass naming scheme (second try after failed #9485) (#9505) 2017-09-20 01:15:20 -04:00
lifx.py Support LIFX Mini products (#10996) 2017-12-08 08:43:37 -08:00
lifx_legacy.py Updated docstrings (#7383) 2017-04-30 20:10:08 -07:00
light_profiles.csv Lights now support profiles 2014-03-26 00:20:02 -07:00
limitlessled.py LimitlessLED: Configurable fade-out behavior (#7369) 2017-06-21 22:22:24 -07:00
litejet.py Do not call update() in constructor (#8878) 2017-08-08 20:21:33 +02:00
lutron.py Add configuration check and use default var names (#7963) 2017-06-09 00:21:06 +02:00
lutron_caseta.py upgrade to new pylutron_caseta with TLS (#10286) 2017-11-10 12:17:25 +01:00
mochad.py Serialize mochad requests (#11029) 2017-12-08 09:18:52 -08:00
mqtt.py Mqtt light options to fix #9330 and #7810 (#9829) 2017-10-31 23:18:49 +01:00
mqtt_json.py fixed duplicate words (#9705) 2017-10-05 21:55:09 +02:00
mqtt_template.py Cleanup and simplitfy the async state update (#9390) 2017-09-12 10:01:03 +02:00
mysensors.py Refactor mysensors callback and add validation (#9069) 2017-08-25 08:58:05 -07:00
mystrom.py Add effects (#8442) 2017-07-11 21:22:00 +02:00
osramlightify.py Update osramlightify.py (#9905) 2017-10-16 22:09:19 +02:00
piglow.py light.piglow update (#7408) 2017-05-02 21:21:37 -07:00
qwikswitch.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
rflink.py Add test cases and fix for device_defaults fire_event option. (#9567) 2017-09-24 15:47:59 -07:00
rfxtrx.py Refactor rfxtrx (#9117) 2017-08-29 16:22:28 +02:00
rpi_gpio_pwm.py Update pwmled to 1.2.1. (#9040) 2017-08-19 13:23:46 +02:00
scsgate.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
sensehat.py light.sensehat: brightness control logic update (#7409) 2017-05-02 17:02:13 -07:00
services.yaml Update services.yaml files (#10229) 2017-10-30 21:39:12 +01:00
skybell.py Skybell (#9681) 2017-10-08 20:14:39 +02:00
tellduslive.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
tellstick.py Tellstick Duo acync callback fix (#10384) 2017-11-09 15:03:35 +01:00
template.py Update template.py 2017-11-01 14:20:29 +01:00
tikteck.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
tplink.py Add emeter attributes (#9903) 2017-10-18 21:52:44 -07:00
tradfri.py Update tradfri.py (#10991) 2017-12-06 12:44:41 +01:00
velbus.py Velbus (#8076) 2017-07-26 14:03:29 +02:00
vera.py Added Vera scenes (#10424) 2017-12-07 07:47:19 +01:00
wemo.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
wink.py Support for Wink Switch and Light groups also fix fan speed selection (#8501) 2017-07-20 00:27:39 +02:00
x10.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
xiaomi_aqara.py Rename xiaomi #9425 (#9426) 2017-09-14 18:49:03 -04:00
xiaomi_miio.py python-miio version bumped for improved device support. (#10720) 2017-11-21 09:23:39 +01:00
yeelight.py Fixed Yeelight's color temperature conversion to RGB (#10831) 2017-11-27 20:54:56 -08:00
yeelightsunflower.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
zengge.py Do not call update() in constructor (#8878) 2017-08-08 20:21:33 +02:00
zha.py Cleanup and simplitfy the async state update (#9390) 2017-09-12 10:01:03 +02:00
zigbee.py 0.28 (#3288) 2016-09-10 18:22:58 -07:00
zwave.py Fix pylint 1.7.2 no-else-return issues (#8361) 2017-07-05 23:30:01 -07:00