35 void setup()
override;
MQTTSensorComponent(sensor::Sensor *sensor)
Construct this MQTTSensorComponent instance with the provided friendly_name and sensor.
void dump_config() override
bool send_initial_state() override
optional< uint32_t > expire_after_
void disable_expire_after()
Disable Home Assistant value expiry.
void setup() override
Override setup.
void set_expire_after(uint32_t expire_after)
Setup an expiry, 0 disables it.
Simple Helper struct used for Home Assistant MQTT send_discovery().
bool publish_state(float value)
std::string unique_id() override
Implementation of SPI Controller mode.
Base-class for all sensors.
uint32_t get_expire_after() const
Get the expire_after in milliseconds used for Home Assistant discovery, first checks override...
std::string component_type() const override
Override for MQTTComponent, returns "sensor".
void send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) override
esphome::sensor::Sensor * sensor
MQTTComponent is the base class for all components that interact with MQTT to expose certain function...
const EntityBase * get_entity() const override