mirror of
https://github.com/esphome/esphome.git
synced 2024-11-28 09:44:12 +01:00
Remove explicit cast for IPAddress (#5574)
* Remove explicit cast for IPAddress * Make linter happy
This commit is contained in:
parent
76417103c7
commit
05a95f8ee9
2 changed files with 7 additions and 3 deletions
|
@ -19,9 +19,7 @@ class MQTTBackendLibreTiny final : public MQTTBackend {
|
||||||
void set_will(const char *topic, uint8_t qos, bool retain, const char *payload) final {
|
void set_will(const char *topic, uint8_t qos, bool retain, const char *payload) final {
|
||||||
mqtt_client_.setWill(topic, qos, retain, payload);
|
mqtt_client_.setWill(topic, qos, retain, payload);
|
||||||
}
|
}
|
||||||
void set_server(network::IPAddress ip, uint16_t port) final {
|
void set_server(network::IPAddress ip, uint16_t port) final { mqtt_client_.setServer(IPAddress(ip), port); }
|
||||||
mqtt_client_.setServer(IPAddress(static_cast<uint32_t>(ip)), port);
|
|
||||||
}
|
|
||||||
void set_server(const char *host, uint16_t port) final { mqtt_client_.setServer(host, port); }
|
void set_server(const char *host, uint16_t port) final { mqtt_client_.setServer(host, port); }
|
||||||
#if ASYNC_TCP_SSL_ENABLED
|
#if ASYNC_TCP_SSL_ENABLED
|
||||||
void set_secure(bool secure) { mqtt_client.setSecure(secure); }
|
void set_secure(bool secure) { mqtt_client.setSecure(secure); }
|
||||||
|
|
|
@ -26,3 +26,9 @@ sensor:
|
||||||
name: ADC
|
name: ADC
|
||||||
pin: GPIO23
|
pin: GPIO23
|
||||||
update_interval: 1s
|
update_interval: 1s
|
||||||
|
|
||||||
|
mqtt:
|
||||||
|
broker: test.mosquitto.org
|
||||||
|
port: 1883
|
||||||
|
discovery: true
|
||||||
|
discovery_prefix: homeassistant
|
||||||
|
|
Loading…
Reference in a new issue