diff --git a/esphomeyaml/components/binary_sensor/esp32_ble_tracker.py b/esphomeyaml/components/binary_sensor/esp32_ble_tracker.py index 7057f890a3..7208afabc6 100644 --- a/esphomeyaml/components/binary_sensor/esp32_ble_tracker.py +++ b/esphomeyaml/components/binary_sensor/esp32_ble_tracker.py @@ -1,15 +1,17 @@ import voluptuous as vol -import esphomeyaml.config_validation as cv from esphomeyaml.components import binary_sensor from esphomeyaml.components.esp32_ble_tracker import CONF_ESP32_BLE_ID, ESP32BLETracker, \ make_address_array +import esphomeyaml.config_validation as cv from esphomeyaml.const import CONF_MAC_ADDRESS, CONF_NAME -from esphomeyaml.helpers import get_variable +from esphomeyaml.helpers import esphomelib_ns, get_variable DEPENDENCIES = ['esp32_ble_tracker'] +ESP32BLEPresenceDevice = esphomelib_ns.ESP32BLEPresenceDevice PLATFORM_SCHEMA = cv.nameable(binary_sensor.BINARY_SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(ESP32BLEPresenceDevice), vol.Required(CONF_MAC_ADDRESS): cv.mac_address, cv.GenerateID(CONF_ESP32_BLE_ID): cv.use_variable_id(ESP32BLETracker) })) diff --git a/esphomeyaml/components/binary_sensor/esp32_touch.py b/esphomeyaml/components/binary_sensor/esp32_touch.py index f122f1b737..7ebde4e93b 100644 --- a/esphomeyaml/components/binary_sensor/esp32_touch.py +++ b/esphomeyaml/components/binary_sensor/esp32_touch.py @@ -34,7 +34,10 @@ def validate_touch_pad(value): return value +ESP32TouchBinarySensor = binary_sensor.binary_sensor_ns.ESP32TouchBinarySensor + PLATFORM_SCHEMA = cv.nameable(binary_sensor.BINARY_SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(ESP32TouchBinarySensor), vol.Required(CONF_PIN): validate_touch_pad, vol.Required(CONF_THRESHOLD): cv.uint16_t, cv.GenerateID(CONF_ESP32_TOUCH_ID): cv.use_variable_id(ESP32TouchComponent), diff --git a/esphomeyaml/components/binary_sensor/gpio.py b/esphomeyaml/components/binary_sensor/gpio.py index 85994ca97f..4d4e880218 100644 --- a/esphomeyaml/components/binary_sensor/gpio.py +++ b/esphomeyaml/components/binary_sensor/gpio.py @@ -7,8 +7,10 @@ from esphomeyaml.const import CONF_MAKE_ID, CONF_NAME, CONF_PIN from esphomeyaml.helpers import App, gpio_input_pin_expression, variable, Application MakeGPIOBinarySensor = Application.MakeGPIOBinarySensor +GPIOBinarySensorComponent = binary_sensor.binary_sensor_ns.GPIOBinarySensorComponent PLATFORM_SCHEMA = cv.nameable(binary_sensor.BINARY_SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(GPIOBinarySensorComponent), cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(MakeGPIOBinarySensor), vol.Required(CONF_PIN): pins.gpio_input_pin_schema })) diff --git a/esphomeyaml/components/binary_sensor/nextion.py b/esphomeyaml/components/binary_sensor/nextion.py index 3a96b4684c..981e85dbb0 100644 --- a/esphomeyaml/components/binary_sensor/nextion.py +++ b/esphomeyaml/components/binary_sensor/nextion.py @@ -1,8 +1,8 @@ import voluptuous as vol -import esphomeyaml.config_validation as cv -from esphomeyaml.components import binary_sensor +from esphomeyaml.components import binary_sensor, display from esphomeyaml.components.display.nextion import Nextion +import esphomeyaml.config_validation as cv from esphomeyaml.const import CONF_COMPONENT_ID, CONF_NAME, CONF_PAGE_ID from esphomeyaml.helpers import get_variable @@ -10,7 +10,10 @@ DEPENDENCIES = ['display'] CONF_NEXTION_ID = 'nextion_id' +NextionTouchComponent = display.display_ns.NextionTouchComponent + PLATFORM_SCHEMA = cv.nameable(binary_sensor.BINARY_SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(NextionTouchComponent), vol.Required(CONF_PAGE_ID): cv.uint8_t, vol.Required(CONF_COMPONENT_ID): cv.uint8_t, cv.GenerateID(CONF_NEXTION_ID): cv.use_variable_id(Nextion) diff --git a/esphomeyaml/components/binary_sensor/pn532.py b/esphomeyaml/components/binary_sensor/pn532.py index 1c2b5be073..fab8482391 100644 --- a/esphomeyaml/components/binary_sensor/pn532.py +++ b/esphomeyaml/components/binary_sensor/pn532.py @@ -27,7 +27,10 @@ def validate_uid(value): return value +PN532BinarySensor = binary_sensor.binary_sensor_ns.PN532BinarySensor + PLATFORM_SCHEMA = cv.nameable(binary_sensor.BINARY_SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(PN532BinarySensor), vol.Required(CONF_UID): validate_uid, cv.GenerateID(CONF_PN532_ID): cv.use_variable_id(PN532Component) })) diff --git a/esphomeyaml/components/binary_sensor/rdm6300.py b/esphomeyaml/components/binary_sensor/rdm6300.py index 394af241ac..ff51f973db 100644 --- a/esphomeyaml/components/binary_sensor/rdm6300.py +++ b/esphomeyaml/components/binary_sensor/rdm6300.py @@ -9,7 +9,10 @@ DEPENDENCIES = ['rdm6300'] CONF_RDM6300_ID = 'rdm6300_id' +RDM6300BinarySensor = binary_sensor.binary_sensor_ns.RDM6300BinarySensor + PLATFORM_SCHEMA = cv.nameable(binary_sensor.BINARY_SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(RDM6300BinarySensor), vol.Required(CONF_UID): cv.uint32_t, cv.GenerateID(CONF_RDM6300_ID): cv.use_variable_id(rdm6300.RDM6300Component) })) diff --git a/esphomeyaml/components/binary_sensor/remote_receiver.py b/esphomeyaml/components/binary_sensor/remote_receiver.py index 51c7efb42c..e2ef0f43c5 100644 --- a/esphomeyaml/components/binary_sensor/remote_receiver.py +++ b/esphomeyaml/components/binary_sensor/remote_receiver.py @@ -36,6 +36,7 @@ RCSwitchTypeCReceiver = remote_ns.RCSwitchTypeCReceiver RCSwitchTypeDReceiver = remote_ns.RCSwitchTypeDReceiver PLATFORM_SCHEMA = cv.nameable(binary_sensor.BINARY_SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(RemoteReceiver), vol.Optional(CONF_LG): vol.Schema({ vol.Required(CONF_DATA): cv.hex_uint32_t, vol.Optional(CONF_NBITS, default=28): vol.All(vol.Coerce(int), cv.one_of(28, 32)), diff --git a/esphomeyaml/components/binary_sensor/status.py b/esphomeyaml/components/binary_sensor/status.py index 11324b887f..af2f0ff66b 100644 --- a/esphomeyaml/components/binary_sensor/status.py +++ b/esphomeyaml/components/binary_sensor/status.py @@ -6,9 +6,11 @@ from esphomeyaml.helpers import App, Application, variable DEPENDENCIES = ['mqtt'] MakeStatusBinarySensor = Application.MakeStatusBinarySensor +StatusBinarySensor = binary_sensor.binary_sensor_ns.StatusBinarySensor PLATFORM_SCHEMA = cv.nameable(binary_sensor.BINARY_SENSOR_PLATFORM_SCHEMA.extend({ cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(MakeStatusBinarySensor), + cv.GenerateID(): cv.declare_variable_id(StatusBinarySensor), })) diff --git a/esphomeyaml/components/binary_sensor/template.py b/esphomeyaml/components/binary_sensor/template.py index 1d5e0f2d36..fb62e24024 100644 --- a/esphomeyaml/components/binary_sensor/template.py +++ b/esphomeyaml/components/binary_sensor/template.py @@ -1,13 +1,15 @@ import voluptuous as vol -import esphomeyaml.config_validation as cv from esphomeyaml.components import binary_sensor +import esphomeyaml.config_validation as cv from esphomeyaml.const import CONF_LAMBDA, CONF_MAKE_ID, CONF_NAME -from esphomeyaml.helpers import App, Application, process_lambda, variable, optional, bool_, add +from esphomeyaml.helpers import App, Application, add, bool_, optional, process_lambda, variable MakeTemplateBinarySensor = Application.MakeTemplateBinarySensor +TemplateBinarySensor = binary_sensor.binary_sensor_ns.TemplateBinarySensor PLATFORM_SCHEMA = cv.nameable(binary_sensor.BINARY_SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(TemplateBinarySensor), cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(MakeTemplateBinarySensor), vol.Required(CONF_LAMBDA): cv.lambda_, })) diff --git a/esphomeyaml/components/sensor/adc.py b/esphomeyaml/components/sensor/adc.py index ca02b815b5..dc0c7bc561 100644 --- a/esphomeyaml/components/sensor/adc.py +++ b/esphomeyaml/components/sensor/adc.py @@ -23,8 +23,10 @@ def validate_adc_pin(value): MakeADCSensor = Application.MakeADCSensor +ADCSensorComponent = sensor.sensor_ns.ADCSensorComponent PLATFORM_SCHEMA = cv.nameable(sensor.SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(ADCSensorComponent), cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(MakeADCSensor), vol.Required(CONF_PIN): validate_adc_pin, vol.Optional(CONF_ATTENUATION): vol.All(cv.only_on_esp32, cv.one_of(*ATTENUATION_MODES)), diff --git a/esphomeyaml/components/sensor/ads1115.py b/esphomeyaml/components/sensor/ads1115.py index 008ea4c291..153d55d640 100644 --- a/esphomeyaml/components/sensor/ads1115.py +++ b/esphomeyaml/components/sensor/ads1115.py @@ -45,7 +45,10 @@ def validate_mux(value): return cv.one_of(*MUX)(value) +ADS1115Sensor = sensor.sensor_ns.ADS1115Sensor + PLATFORM_SCHEMA = cv.nameable(sensor.SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(ADS1115Sensor), vol.Required(CONF_MULTIPLEXER): validate_mux, vol.Required(CONF_GAIN): validate_gain, cv.GenerateID(CONF_ADS1115_ID): cv.use_variable_id(ADS1115Component), diff --git a/esphomeyaml/components/sensor/bh1750.py b/esphomeyaml/components/sensor/bh1750.py index dd43d5e0de..d04041c2f8 100644 --- a/esphomeyaml/components/sensor/bh1750.py +++ b/esphomeyaml/components/sensor/bh1750.py @@ -15,8 +15,10 @@ BH1750_RESOLUTIONS = { } MakeBH1750Sensor = Application.MakeBH1750Sensor +BH1750Sensor = sensor.sensor_ns.BH1750Sensor PLATFORM_SCHEMA = cv.nameable(sensor.SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(BH1750Sensor), cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(MakeBH1750Sensor), vol.Optional(CONF_ADDRESS, default=0x23): cv.i2c_address, vol.Optional(CONF_RESOLUTION): vol.All(cv.positive_float, cv.one_of(*BH1750_RESOLUTIONS)), diff --git a/esphomeyaml/components/sensor/ble_rssi.py b/esphomeyaml/components/sensor/ble_rssi.py index 01bc1704bb..4240b41bd4 100644 --- a/esphomeyaml/components/sensor/ble_rssi.py +++ b/esphomeyaml/components/sensor/ble_rssi.py @@ -5,11 +5,14 @@ from esphomeyaml.components import sensor from esphomeyaml.components.esp32_ble_tracker import CONF_ESP32_BLE_ID, ESP32BLETracker, \ make_address_array from esphomeyaml.const import CONF_MAC_ADDRESS, CONF_NAME -from esphomeyaml.helpers import get_variable +from esphomeyaml.helpers import get_variable, esphomelib_ns DEPENDENCIES = ['esp32_ble_tracker'] +ESP32BLERSSISensor = esphomelib_ns.ESP32BLERSSISensor + PLATFORM_SCHEMA = cv.nameable(sensor.SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(ESP32BLERSSISensor), vol.Required(CONF_MAC_ADDRESS): cv.mac_address, cv.GenerateID(CONF_ESP32_BLE_ID): cv.use_variable_id(ESP32BLETracker) })) diff --git a/esphomeyaml/components/sensor/dallas.py b/esphomeyaml/components/sensor/dallas.py index 42fc2035b8..a5706cbf5e 100644 --- a/esphomeyaml/components/sensor/dallas.py +++ b/esphomeyaml/components/sensor/dallas.py @@ -7,7 +7,10 @@ from esphomeyaml.const import CONF_ADDRESS, CONF_DALLAS_ID, CONF_INDEX, CONF_NAM CONF_RESOLUTION from esphomeyaml.helpers import HexIntLiteral, get_variable +DallasTemperatureSensor = sensor.sensor_ns.DallasTemperatureSensor + PLATFORM_SCHEMA = cv.nameable(sensor.SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(DallasTemperatureSensor), vol.Exclusive(CONF_ADDRESS, 'dallas'): cv.hex_int, vol.Exclusive(CONF_INDEX, 'dallas'): cv.positive_int, cv.GenerateID(CONF_DALLAS_ID): cv.use_variable_id(DallasComponent), diff --git a/esphomeyaml/components/sensor/duty_cycle.py b/esphomeyaml/components/sensor/duty_cycle.py index 0bd41b9976..58cf433070 100644 --- a/esphomeyaml/components/sensor/duty_cycle.py +++ b/esphomeyaml/components/sensor/duty_cycle.py @@ -7,8 +7,10 @@ from esphomeyaml.const import CONF_MAKE_ID, CONF_NAME, CONF_PIN, CONF_UPDATE_INT from esphomeyaml.helpers import App, Application, gpio_input_pin_expression, variable MakeDutyCycleSensor = Application.MakeDutyCycleSensor +DutyCycleSensor = sensor.sensor_ns.DutyCycleSensor PLATFORM_SCHEMA = cv.nameable(sensor.SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(DutyCycleSensor), cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(MakeDutyCycleSensor), vol.Required(CONF_PIN): pins.internal_gpio_input_pin_schema, vol.Optional(CONF_UPDATE_INTERVAL): cv.update_interval, diff --git a/esphomeyaml/components/sensor/esp32_hall.py b/esphomeyaml/components/sensor/esp32_hall.py index 2bdb062e8e..e86377dd39 100644 --- a/esphomeyaml/components/sensor/esp32_hall.py +++ b/esphomeyaml/components/sensor/esp32_hall.py @@ -8,8 +8,10 @@ from esphomeyaml.helpers import App, Application, variable ESP_PLATFORMS = [ESP_PLATFORM_ESP32] MakeESP32HallSensor = Application.MakeESP32HallSensor +ESP32HallSensor = sensor.sensor_ns.ESP32HallSensor PLATFORM_SCHEMA = cv.nameable(sensor.SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(ESP32HallSensor), cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(MakeESP32HallSensor), vol.Optional(CONF_UPDATE_INTERVAL): cv.update_interval, })) diff --git a/esphomeyaml/components/sensor/max6675.py b/esphomeyaml/components/sensor/max6675.py index 007acbd6b4..5d2432de62 100644 --- a/esphomeyaml/components/sensor/max6675.py +++ b/esphomeyaml/components/sensor/max6675.py @@ -9,8 +9,10 @@ from esphomeyaml.const import CONF_CS_PIN, CONF_MAKE_ID, CONF_NAME, CONF_SPI_ID, from esphomeyaml.helpers import App, Application, get_variable, gpio_output_pin_expression, variable MakeMAX6675Sensor = Application.MakeMAX6675Sensor +MAX6675Sensor = sensor.sensor_ns.MAX6675Sensor PLATFORM_SCHEMA = cv.nameable(sensor.SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(MAX6675Sensor), cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(MakeMAX6675Sensor), cv.GenerateID(CONF_SPI_ID): cv.use_variable_id(SPIComponent), vol.Required(CONF_CS_PIN): pins.gpio_output_pin_schema, diff --git a/esphomeyaml/components/sensor/mqtt_subscribe.py b/esphomeyaml/components/sensor/mqtt_subscribe.py index 8b8ce50317..203c2595d6 100644 --- a/esphomeyaml/components/sensor/mqtt_subscribe.py +++ b/esphomeyaml/components/sensor/mqtt_subscribe.py @@ -8,8 +8,10 @@ from esphomeyaml.helpers import App, Application, add, variable DEPENDENCIES = ['mqtt'] MakeMQTTSubscribeSensor = Application.MakeMQTTSubscribeSensor +MQTTSubscribeSensor = sensor.sensor_ns.MQTTSubscribeSensor PLATFORM_SCHEMA = cv.nameable(sensor.SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(MQTTSubscribeSensor), cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(MakeMQTTSubscribeSensor), vol.Required(CONF_TOPIC): cv.subscribe_topic, vol.Optional(CONF_QOS): cv.mqtt_qos, diff --git a/esphomeyaml/components/sensor/pulse_counter.py b/esphomeyaml/components/sensor/pulse_counter.py index 3b3200ea56..49bdfb68cb 100644 --- a/esphomeyaml/components/sensor/pulse_counter.py +++ b/esphomeyaml/components/sensor/pulse_counter.py @@ -17,6 +17,7 @@ COUNT_MODES = { COUNT_MODE_SCHEMA = vol.All(vol.Upper, cv.one_of(*COUNT_MODES)) MakePulseCounterSensor = Application.MakePulseCounterSensor +PulseCounterSensorComponent = sensor.sensor_ns.PulseCounterSensorComponent def validate_internal_filter(value): @@ -33,6 +34,7 @@ def validate_internal_filter(value): PLATFORM_SCHEMA = cv.nameable(sensor.SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(PulseCounterSensorComponent), cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(MakePulseCounterSensor), vol.Required(CONF_PIN): pins.internal_gpio_input_pin_schema, vol.Optional(CONF_COUNT_MODE): vol.Schema({ diff --git a/esphomeyaml/components/sensor/rotary_encoder.py b/esphomeyaml/components/sensor/rotary_encoder.py index 22c5552bfc..595d398bb8 100644 --- a/esphomeyaml/components/sensor/rotary_encoder.py +++ b/esphomeyaml/components/sensor/rotary_encoder.py @@ -17,8 +17,10 @@ CONF_PIN_B = 'pin_b' CONF_PIN_RESET = 'pin_reset' MakeRotaryEncoderSensor = Application.MakeRotaryEncoderSensor +RotaryEncoderSensor = sensor.sensor_ns.RotaryEncoderSensor PLATFORM_SCHEMA = cv.nameable(sensor.SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(RotaryEncoderSensor), cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(MakeRotaryEncoderSensor), vol.Required(CONF_PIN_A): pins.internal_gpio_input_pin_schema, vol.Required(CONF_PIN_B): pins.internal_gpio_input_pin_schema, diff --git a/esphomeyaml/components/sensor/template.py b/esphomeyaml/components/sensor/template.py index 8c115a9239..5f090fb5b0 100644 --- a/esphomeyaml/components/sensor/template.py +++ b/esphomeyaml/components/sensor/template.py @@ -6,8 +6,10 @@ from esphomeyaml.const import CONF_LAMBDA, CONF_MAKE_ID, CONF_NAME, CONF_UPDATE_ from esphomeyaml.helpers import App, process_lambda, variable, Application, float_, optional, add MakeTemplateSensor = Application.MakeTemplateSensor +TemplateSensor = sensor.sensor_ns.TemplateSensor PLATFORM_SCHEMA = cv.nameable(sensor.SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(TemplateSensor), cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(MakeTemplateSensor), vol.Required(CONF_LAMBDA): cv.lambda_, vol.Optional(CONF_UPDATE_INTERVAL): cv.update_interval, diff --git a/esphomeyaml/components/sensor/tsl2561.py b/esphomeyaml/components/sensor/tsl2561.py index 0f973de264..3bf94eb0ce 100644 --- a/esphomeyaml/components/sensor/tsl2561.py +++ b/esphomeyaml/components/sensor/tsl2561.py @@ -29,8 +29,10 @@ def validate_integration_time(value): MakeTSL2561Sensor = Application.MakeTSL2561Sensor +TSL2561Sensor = Application.TSL2561Sensor PLATFORM_SCHEMA = cv.nameable(sensor.SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(TSL2561Sensor), cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(MakeTSL2561Sensor), vol.Optional(CONF_ADDRESS, default=0x39): cv.i2c_address, vol.Optional(CONF_INTEGRATION_TIME): validate_integration_time, diff --git a/esphomeyaml/components/sensor/ultrasonic.py b/esphomeyaml/components/sensor/ultrasonic.py index 75c56090ca..61794f431d 100644 --- a/esphomeyaml/components/sensor/ultrasonic.py +++ b/esphomeyaml/components/sensor/ultrasonic.py @@ -9,8 +9,10 @@ from esphomeyaml.helpers import App, Application, add, gpio_input_pin_expression gpio_output_pin_expression, variable MakeUltrasonicSensor = Application.MakeUltrasonicSensor +UltrasonicSensorComponent = sensor.sensor_ns.UltrasonicSensorComponent PLATFORM_SCHEMA = cv.nameable(sensor.SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(UltrasonicSensorComponent), cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(MakeUltrasonicSensor), vol.Required(CONF_TRIGGER_PIN): pins.gpio_output_pin_schema, vol.Required(CONF_ECHO_PIN): pins.internal_gpio_input_pin_schema, diff --git a/esphomeyaml/components/sensor/uptime.py b/esphomeyaml/components/sensor/uptime.py index b58e595e27..38548c1db3 100644 --- a/esphomeyaml/components/sensor/uptime.py +++ b/esphomeyaml/components/sensor/uptime.py @@ -6,8 +6,10 @@ from esphomeyaml.const import CONF_MAKE_ID, CONF_NAME, CONF_UPDATE_INTERVAL from esphomeyaml.helpers import App, Application, variable MakeUptimeSensor = Application.MakeUptimeSensor +UptimeSensor = sensor.sensor_ns.UptimeSensor PLATFORM_SCHEMA = cv.nameable(sensor.SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(UptimeSensor), cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(MakeUptimeSensor), vol.Optional(CONF_UPDATE_INTERVAL): cv.update_interval, })) diff --git a/esphomeyaml/components/sensor/wifi_signal.py b/esphomeyaml/components/sensor/wifi_signal.py index f9b10a0a2f..060377839e 100644 --- a/esphomeyaml/components/sensor/wifi_signal.py +++ b/esphomeyaml/components/sensor/wifi_signal.py @@ -6,8 +6,10 @@ from esphomeyaml.const import CONF_MAKE_ID, CONF_NAME, CONF_UPDATE_INTERVAL from esphomeyaml.helpers import App, Application, variable MakeWiFiSignalSensor = Application.MakeWiFiSignalSensor +WiFiSignalSensor = sensor.sensor_ns.WiFiSignalSensor PLATFORM_SCHEMA = cv.nameable(sensor.SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(WiFiSignalSensor), cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(MakeWiFiSignalSensor), vol.Optional(CONF_UPDATE_INTERVAL): cv.update_interval, })) diff --git a/esphomeyaml/components/switch/output.py b/esphomeyaml/components/switch/output.py index 05076930b4..bc5d9b6d7e 100644 --- a/esphomeyaml/components/switch/output.py +++ b/esphomeyaml/components/switch/output.py @@ -6,8 +6,10 @@ from esphomeyaml.const import CONF_MAKE_ID, CONF_NAME, CONF_OUTPUT from esphomeyaml.helpers import App, Application, get_variable, variable MakeOutputSwitch = Application.MakeOutputSwitch +OutputSwitch = switch.switch_ns.OutputSwitch PLATFORM_SCHEMA = cv.nameable(switch.SWITCH_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(OutputSwitch), cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(MakeOutputSwitch), vol.Required(CONF_OUTPUT): cv.use_variable_id(None), })) diff --git a/esphomeyaml/components/switch/remote_transmitter.py b/esphomeyaml/components/switch/remote_transmitter.py index 9daf53c42e..2ac9ee8e75 100644 --- a/esphomeyaml/components/switch/remote_transmitter.py +++ b/esphomeyaml/components/switch/remote_transmitter.py @@ -39,6 +39,7 @@ RCSwitchTypeDTransmitter = remote_ns.RCSwitchTypeDTransmitter validate_raw_data = [vol.Any(vol.Coerce(int), cv.time_period_microseconds)] PLATFORM_SCHEMA = cv.nameable(switch.SWITCH_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(RemoteTransmitter), vol.Optional(CONF_LG): vol.Schema({ vol.Required(CONF_DATA): cv.hex_uint32_t, vol.Optional(CONF_NBITS, default=28): vol.All(vol.Coerce(int), cv.one_of(28, 32)), diff --git a/esphomeyaml/components/switch/restart.py b/esphomeyaml/components/switch/restart.py index 73f9182429..90a8f1de3f 100644 --- a/esphomeyaml/components/switch/restart.py +++ b/esphomeyaml/components/switch/restart.py @@ -6,8 +6,10 @@ from esphomeyaml.const import CONF_INVERTED, CONF_MAKE_ID, CONF_NAME from esphomeyaml.helpers import App, Application, variable MakeRestartSwitch = Application.MakeRestartSwitch +RestartSwitch = switch.switch_ns.RestartSwitch PLATFORM_SCHEMA = cv.nameable(switch.SWITCH_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(RestartSwitch), cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(MakeRestartSwitch), vol.Optional(CONF_INVERTED): cv.invalid("Restart switches do not support inverted mode!"), })) diff --git a/esphomeyaml/components/switch/shutdown.py b/esphomeyaml/components/switch/shutdown.py index 6116136ca4..330750eb0c 100644 --- a/esphomeyaml/components/switch/shutdown.py +++ b/esphomeyaml/components/switch/shutdown.py @@ -6,8 +6,10 @@ from esphomeyaml.const import CONF_INVERTED, CONF_MAKE_ID, CONF_NAME from esphomeyaml.helpers import App, Application, variable MakeShutdownSwitch = Application.MakeShutdownSwitch +ShutdownSwitch = switch.switch_ns.ShutdownSwitch PLATFORM_SCHEMA = cv.nameable(switch.SWITCH_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(ShutdownSwitch), cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(MakeShutdownSwitch), vol.Optional(CONF_INVERTED): cv.invalid("Shutdown switches do not support inverted mode!"), })) diff --git a/esphomeyaml/components/switch/uart.py b/esphomeyaml/components/switch/uart.py index e64f05f1ab..dccfc75deb 100644 --- a/esphomeyaml/components/switch/uart.py +++ b/esphomeyaml/components/switch/uart.py @@ -10,6 +10,7 @@ from esphomeyaml.helpers import App, Application, ArrayInitializer, get_variable DEPENDENCIES = ['uart'] MakeUARTSwitch = Application.MakeUARTSwitch +UARTSwitch = switch.switch_ns.UARTSwitch def validate_data(value): @@ -23,6 +24,7 @@ def validate_data(value): PLATFORM_SCHEMA = cv.nameable(switch.SWITCH_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(UARTSwitch), cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(MakeUARTSwitch), cv.GenerateID(CONF_UART_ID): cv.use_variable_id(UARTComponent), vol.Required(CONF_DATA): validate_data, diff --git a/esphomeyaml/components/text_sensor/mqtt_subscribe.py b/esphomeyaml/components/text_sensor/mqtt_subscribe.py index a4ba9705c1..7b2ea32449 100644 --- a/esphomeyaml/components/text_sensor/mqtt_subscribe.py +++ b/esphomeyaml/components/text_sensor/mqtt_subscribe.py @@ -8,8 +8,10 @@ from esphomeyaml.helpers import App, Application, add, variable DEPENDENCIES = ['mqtt'] MakeMQTTSubscribeTextSensor = Application.MakeMQTTSubscribeTextSensor +MQTTSubscribeTextSensor = text_sensor.text_sensor_ns.MQTTSubscribeTextSensor PLATFORM_SCHEMA = cv.nameable(text_sensor.TEXT_SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(MQTTSubscribeTextSensor), cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(MakeMQTTSubscribeTextSensor), vol.Required(CONF_TOPIC): cv.subscribe_topic, vol.Optional(CONF_QOS): cv.mqtt_qos, diff --git a/esphomeyaml/components/text_sensor/template.py b/esphomeyaml/components/text_sensor/template.py index 3441ee5e6f..4a15ce967d 100644 --- a/esphomeyaml/components/text_sensor/template.py +++ b/esphomeyaml/components/text_sensor/template.py @@ -7,8 +7,10 @@ from esphomeyaml.helpers import App, Application, add, optional, process_lambda, variable MakeTemplateTextSensor = Application.MakeTemplateTextSensor +TemplateTextSensor = text_sensor.text_sensor_ns.TemplateTextSensor PLATFORM_SCHEMA = cv.nameable(text_sensor.TEXT_SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(TemplateTextSensor), cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(MakeTemplateTextSensor), vol.Required(CONF_LAMBDA): cv.lambda_, vol.Optional(CONF_UPDATE_INTERVAL): cv.update_interval, diff --git a/esphomeyaml/components/text_sensor/version.py b/esphomeyaml/components/text_sensor/version.py index 7e01302924..6eb8396000 100644 --- a/esphomeyaml/components/text_sensor/version.py +++ b/esphomeyaml/components/text_sensor/version.py @@ -4,8 +4,10 @@ from esphomeyaml.const import CONF_MAKE_ID, CONF_NAME from esphomeyaml.helpers import App, Application, variable MakeVersionTextSensor = Application.MakeVersionTextSensor +VersionTextSensor = text_sensor.text_sensor_ns.VersionTextSensor PLATFORM_SCHEMA = cv.nameable(text_sensor.TEXT_SENSOR_PLATFORM_SCHEMA.extend({ + cv.GenerateID(): cv.declare_variable_id(VersionTextSensor), cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(MakeVersionTextSensor), })) diff --git a/esphomeyaml/writer.py b/esphomeyaml/writer.py index c045fade11..4f1900c662 100644 --- a/esphomeyaml/writer.py +++ b/esphomeyaml/writer.py @@ -103,6 +103,7 @@ def get_ini_content(config, path): build_flags |= get_build_flags(config, 'BUILD_FLAGS') build_flags.add(u"-DESPHOMEYAML_USE") build_flags.add("-Wno-unused-variable") + build_flags.add("-Wno-unused-but-set-variable") build_flags |= get_build_flags(config, 'required_build_flags') build_flags |= get_build_flags(config, 'REQUIRED_BUILD_FLAGS')