Remove explicit cast for IPAddress (#5574)

* Remove explicit cast for IPAddress

* Make linter happy
This commit is contained in:
Jimmy Hedman 2023-10-21 06:04:07 +02:00 committed by Jesse Hills
parent 76ab923780
commit c47f8fc02c
No known key found for this signature in database
GPG Key ID: BEAAE804EFD8E83A
2 changed files with 7 additions and 3 deletions

View File

@ -19,9 +19,7 @@ class MQTTBackendLibreTiny final : public MQTTBackend {
void set_will(const char *topic, uint8_t qos, bool retain, const char *payload) final {
mqtt_client_.setWill(topic, qos, retain, payload);
}
void set_server(network::IPAddress ip, uint16_t port) final {
mqtt_client_.setServer(IPAddress(static_cast<uint32_t>(ip)), port);
}
void set_server(network::IPAddress ip, uint16_t port) final { mqtt_client_.setServer(IPAddress(ip), port); }
void set_server(const char *host, uint16_t port) final { mqtt_client_.setServer(host, port); }
#if ASYNC_TCP_SSL_ENABLED
void set_secure(bool secure) { mqtt_client.setSecure(secure); }

View File

@ -26,3 +26,9 @@ sensor:
name: ADC
pin: GPIO23
update_interval: 1s
mqtt:
broker: test.mosquitto.org
port: 1883
discovery: true
discovery_prefix: homeassistant