mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 15:12:06 +00:00 
			
		
		
		
	Merge branch 'light_bitmask' into integration
This commit is contained in:
		| @@ -913,9 +913,9 @@ void ListEntitiesLightResponse::dump_to(std::string &out) const { | |||||||
|   dump_field(out, "object_id", this->object_id_ref_); |   dump_field(out, "object_id", this->object_id_ref_); | ||||||
|   dump_field(out, "key", this->key); |   dump_field(out, "key", this->key); | ||||||
|   dump_field(out, "name", this->name_ref_); |   dump_field(out, "name", this->name_ref_); | ||||||
|   out.append("  supported_color_modes: 0x"); |   char buffer[64]; | ||||||
|   out.append(uint32_to_string(this->supported_color_modes)); |   snprintf(buffer, sizeof(buffer), "  supported_color_modes: 0x%08" PRIX32 "\n", this->supported_color_modes); | ||||||
|   out.append("\n"); |   out.append(buffer); | ||||||
|   dump_field(out, "min_mireds", this->min_mireds); |   dump_field(out, "min_mireds", this->min_mireds); | ||||||
|   dump_field(out, "max_mireds", this->max_mireds); |   dump_field(out, "max_mireds", this->max_mireds); | ||||||
|   for (const auto &it : this->effects) { |   for (const auto &it : this->effects) { | ||||||
|   | |||||||
| @@ -43,7 +43,6 @@ void LightJSONSchema::dump_json(LightState &state, JsonObject root) { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   auto values = state.remote_values; |   auto values = state.remote_values; | ||||||
|   auto traits = state.get_output()->get_traits(); |  | ||||||
|  |  | ||||||
|   const auto color_mode = values.get_color_mode(); |   const auto color_mode = values.get_color_mode(); | ||||||
|   const char *mode_str = get_color_mode_json_str(color_mode); |   const char *mode_str = get_color_mode_json_str(color_mode); | ||||||
|   | |||||||
| @@ -191,11 +191,9 @@ void LightState::current_values_as_brightness(float *brightness) { | |||||||
|   this->current_values.as_brightness(brightness, this->gamma_correct_); |   this->current_values.as_brightness(brightness, this->gamma_correct_); | ||||||
| } | } | ||||||
| void LightState::current_values_as_rgb(float *red, float *green, float *blue, bool color_interlock) { | void LightState::current_values_as_rgb(float *red, float *green, float *blue, bool color_interlock) { | ||||||
|   auto traits = this->get_traits(); |  | ||||||
|   this->current_values.as_rgb(red, green, blue, this->gamma_correct_, false); |   this->current_values.as_rgb(red, green, blue, this->gamma_correct_, false); | ||||||
| } | } | ||||||
| void LightState::current_values_as_rgbw(float *red, float *green, float *blue, float *white, bool color_interlock) { | void LightState::current_values_as_rgbw(float *red, float *green, float *blue, float *white, bool color_interlock) { | ||||||
|   auto traits = this->get_traits(); |  | ||||||
|   this->current_values.as_rgbw(red, green, blue, white, this->gamma_correct_, false); |   this->current_values.as_rgbw(red, green, blue, white, this->gamma_correct_, false); | ||||||
| } | } | ||||||
| void LightState::current_values_as_rgbww(float *red, float *green, float *blue, float *cold_white, float *warm_white, | void LightState::current_values_as_rgbww(float *red, float *green, float *blue, float *cold_white, float *warm_white, | ||||||
| @@ -209,7 +207,6 @@ void LightState::current_values_as_rgbct(float *red, float *green, float *blue, | |||||||
|                                 white_brightness, this->gamma_correct_); |                                 white_brightness, this->gamma_correct_); | ||||||
| } | } | ||||||
| void LightState::current_values_as_cwww(float *cold_white, float *warm_white, bool constant_brightness) { | void LightState::current_values_as_cwww(float *cold_white, float *warm_white, bool constant_brightness) { | ||||||
|   auto traits = this->get_traits(); |  | ||||||
|   this->current_values.as_cwww(cold_white, warm_white, this->gamma_correct_, constant_brightness); |   this->current_values.as_cwww(cold_white, warm_white, this->gamma_correct_, constant_brightness); | ||||||
| } | } | ||||||
| void LightState::current_values_as_ct(float *color_temperature, float *white_brightness) { | void LightState::current_values_as_ct(float *color_temperature, float *white_brightness) { | ||||||
|   | |||||||
| @@ -1564,9 +1564,9 @@ class RepeatedTypeInfo(TypeInfo): | |||||||
|         if self._use_bitmask: |         if self._use_bitmask: | ||||||
|             # For bitmask fields, dump the hex value of the bitmask |             # For bitmask fields, dump the hex value of the bitmask | ||||||
|             return ( |             return ( | ||||||
|                 f'out.append("  {self.field_name}: 0x");\n' |                 f"char buffer[64];\n" | ||||||
|                 f"out.append(uint32_to_string(this->{self.field_name}));\n" |                 f'snprintf(buffer, sizeof(buffer), "  {self.field_name}: 0x%08" PRIX32 "\\n", this->{self.field_name});\n' | ||||||
|                 f'out.append("\\n");' |                 f"out.append(buffer);" | ||||||
|             ) |             ) | ||||||
|         if self._use_pointer: |         if self._use_pointer: | ||||||
|             # For pointer fields, dereference and use the existing helper |             # For pointer fields, dereference and use the existing helper | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user