From d107933e80f82dbe3fc38ba5c60d9ed1f5147d9d Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 16 Sep 2019 16:59:05 +0200 Subject: [PATCH] Revert "Merge branch 'development' of https://github.com/arendst/Sonoff-Tasmota into development" This reverts commit d82afa1190c1d35a23c981e3439f2b83d044cf37, reversing changes made to 7b70c042bdd6167ef67dabf041590120d9d20d9f. --- sonoff/xdrv_12_home_assistant.ino | 43 ------------------------------- 1 file changed, 43 deletions(-) diff --git a/sonoff/xdrv_12_home_assistant.ino b/sonoff/xdrv_12_home_assistant.ino index d794d9543..538c25e06 100644 --- a/sonoff/xdrv_12_home_assistant.ino +++ b/sonoff/xdrv_12_home_assistant.ino @@ -152,11 +152,6 @@ const char HASS_DISCOVER_DEVICE_INFO_SHORT[] PROGMEM = const char HASS_DISCOVER_TOPIC_PREFIX[] PROGMEM = ",\"~\":\"%s\""; -const char HASS_DISCOVER_INFO_WIFI[] PROGMEM = - // Combined WiFi sensor, not usable for graph in Hass // - ",\"val_tpl\":\"{{[value_json.Wifi." D_JSON_SSID ", value_json.Wifi." D_JSON_RSSI "] | join (' (') + '%%)' }}\"," - "\"dev_cla\":\"signal_strength\""; // device_class: signal_strength - uint8_t hass_init_step = 0; uint8_t hass_mode = 0; int hass_tele_period = 0; @@ -559,41 +554,6 @@ void HAssPublishStatus(void) MqttPublishPrefixTopic_P(TELE, PSTR(D_RSLT_HASS_STATE)); } -void HAssAnnounceWifiSensor(void) -{ - char stopic[TOPSZ]; - char stemp1[TOPSZ]; - char stemp2[TOPSZ]; - char unique_id[30]; - - // Announce sensor - mqtt_data[0] = '\0'; // Clear retained message - - // Clear or Set topic - snprintf_P(unique_id, sizeof(unique_id), PSTR("%06X_conn"), ESP.getChipId()); - snprintf_P(stopic, sizeof(stopic), PSTR(HOME_ASSISTANT_DISCOVERY_PREFIX "/sensor/%s/config"), unique_id); - - if (Settings.flag.hass_discovery) { - char name[33+11]; // friendlyname(33) + + " " + "connection" - char *state_topic = stemp1; - char *availability_topic = stemp2; - char prefix[TOPSZ]; - - snprintf_P(name, sizeof(name), PSTR("%s Connection"), Settings.friendlyname[0]); // "Connection" could be translated, should be added to language files - GetTopic_P(state_topic, TELE, mqtt_topic, PSTR(D_RSLT_STATE)); - GetTopic_P(availability_topic, TELE, mqtt_topic, S_LWT); - FindPrefix(state_topic, availability_topic, prefix); - Shorten(&state_topic, prefix); - Shorten(&availability_topic, prefix); - - Response_P(HASS_DISCOVER_SENSOR, name, state_topic, availability_topic); - TryResponseAppend_P(HASS_DISCOVER_INFO_WIFI, unique_id, ESP.getChipId(), WiFi.macAddress().c_str()); - TryResponseAppend_P(HASS_DISCOVER_TOPIC_PREFIX, prefix); - TryResponseAppend_P(PSTR("}")); - } - MqttPublish(stopic, true); -} - void HAssDiscovery(void) { // Configure Tasmota for default Home Assistant parameters to keep discovery message as short as possible @@ -624,9 +584,6 @@ void HAssDiscovery(void) // Send info about status sensor HAssAnnounceStatusSensor(); - - // Send info about Wifi - HAssAnnounceWifiSensor(); } }