mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 06:33:51 +00:00 
			
		
		
		
	rmt_base additional minor changes (#5245)
This commit is contained in:
		| @@ -1488,10 +1488,7 @@ MideaData, MideaBinarySensor, MideaTrigger, MideaAction, MideaDumper = declare_p | ||||
| MideaAction = ns.class_("MideaAction", RemoteTransmitterActionBase) | ||||
| MIDEA_SCHEMA = cv.Schema( | ||||
|     { | ||||
|         cv.Required(CONF_CODE): cv.All( | ||||
|             [cv.Any(cv.hex_uint8_t, cv.uint8_t)], | ||||
|             cv.Length(min=5, max=5), | ||||
|         ), | ||||
|         cv.Required(CONF_CODE): cv.All([cv.hex_uint8_t], cv.Length(min=5, max=5)), | ||||
|     } | ||||
| ) | ||||
|  | ||||
| @@ -1511,15 +1508,10 @@ def midea_dumper(var, config): | ||||
|     pass | ||||
|  | ||||
|  | ||||
| @register_action( | ||||
|     "midea", | ||||
|     MideaAction, | ||||
|     MIDEA_SCHEMA, | ||||
| ) | ||||
| @register_action("midea", MideaAction, MIDEA_SCHEMA) | ||||
| async def midea_action(var, config, args): | ||||
|     template_ = await cg.templatable( | ||||
|         config[CONF_CODE], args, cg.std_vector.template(cg.uint8) | ||||
|     ) | ||||
|     vec_ = cg.std_vector.template(cg.uint8) | ||||
|     template_ = await cg.templatable(config[CONF_CODE], args, vec_, vec_) | ||||
|     cg.add(var.set_code(template_)) | ||||
|  | ||||
|  | ||||
| @@ -1530,10 +1522,7 @@ AEHAData, AEHABinarySensor, AEHATrigger, AEHAAction, AEHADumper = declare_protoc | ||||
| AEHA_SCHEMA = cv.Schema( | ||||
|     { | ||||
|         cv.Required(CONF_ADDRESS): cv.hex_uint16_t, | ||||
|         cv.Required(CONF_DATA): cv.All( | ||||
|             [cv.Any(cv.hex_uint8_t, cv.uint8_t)], | ||||
|             cv.Length(min=2, max=35), | ||||
|         ), | ||||
|         cv.Required(CONF_DATA): cv.All([cv.hex_uint8_t], cv.Length(min=2, max=35)), | ||||
|     } | ||||
| ) | ||||
|  | ||||
|   | ||||
| @@ -84,7 +84,6 @@ using MideaDumper = RemoteReceiverDumper<MideaProtocol, MideaData>; | ||||
|  | ||||
| template<typename... Ts> class MideaAction : public RemoteTransmitterActionBase<Ts...> { | ||||
|   TEMPLATABLE_VALUE(std::vector<uint8_t>, code) | ||||
|   void set_code(std::initializer_list<uint8_t> code) { this->code_ = code; } | ||||
|  | ||||
|   void encode(RemoteTransmitData *dst, Ts... x) override { | ||||
|     MideaData data(this->code_.value(x...)); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user