[sensor] Narrow pragma to just the raw_state access line, matching select pattern

This commit is contained in:
J. Nick Koston
2026-03-22 19:19:09 -10:00
parent cab07c537e
commit 5519c2a5a3
+2 -2
View File
@@ -65,10 +65,11 @@ StateClass Sensor::get_state_class() {
return StateClass::STATE_CLASS_NONE;
}
void Sensor::publish_state(float state) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
void Sensor::publish_state(float state) {
this->raw_state = state;
#pragma GCC diagnostic pop
#ifdef USE_SENSOR_FILTER
this->raw_callback_.call(state);
#endif
@@ -85,7 +86,6 @@ void Sensor::publish_state(float state) {
}
#endif
}
#pragma GCC diagnostic pop
#ifdef USE_SENSOR_FILTER
void Sensor::add_filter(Filter *filter) {