mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	Fix custom output, add test
Fixes https://github.com/esphome/issues/issues/346
This commit is contained in:
		| @@ -26,3 +26,13 @@ class CustomComponent : public PollingComponent { | ||||
|   void setup() override { ESP_LOGD("custom_component", "Setup"); } | ||||
|   void update() override { ESP_LOGD("custom_component", "Update"); } | ||||
| }; | ||||
|  | ||||
| class CustomBinaryOutput : public BinaryOutput, public Component { | ||||
|  protected: | ||||
|   void write_state(bool state) override { ESP_LOGD("custom_output", "Setting %s", ONOFF(state)); } | ||||
| }; | ||||
|  | ||||
| class CustomFloatOutput : public FloatOutput, public Component { | ||||
|  protected: | ||||
|   void write_state(float state) override { ESP_LOGD("custom_output", "Setting %f", state); } | ||||
| }; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user