-
Notifications
You must be signed in to change notification settings - Fork 847
Changing WebUI to support end-user setting display BLE advertised device name vs current model_id #2218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
plambrechtsen
wants to merge
28
commits into
1technophile:development
Choose a base branch
from
plambrechtsen:displaydevicename
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changing WebUI to support end-user setting display BLE advertised device name vs current model_id #2218
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
70c992f
Changing WebUI to include display device name, and change it to selec…
plambrechtsen 5f20c72
Fix mqttDiscovery to require WebUI and ESP32 for displayDeviceName
plambrechtsen df1d711
Fix mqttDiscovery to require WebUI and ESP32 and ESP8266 for displayD…
plambrechtsen 90f1360
Changing WebUI to include display device name, and change it to selec…
plambrechtsen 8fb8f41
Fixes for WebUI and BT for supporting custom setting Display name
plambrechtsen 9817461
Fixes for WebUI and BT for supporting custom setting Display name
plambrechtsen 966c234
Move DISPLAY_DEVICE_NAME to User_config.h
plambrechtsen 56f1bb2
Update docs to include change for Display temperature
plambrechtsen f9df090
Update docs to include change for Display temperature
plambrechtsen 6ff9d61
Fix minor cosmetic bug where devices were not linking in HA to the ga…
plambrechtsen 047cfc3
Merge branch 'development' into displaydevicename
plambrechtsen 51a7525
Roll back displayMetric and gateway_mac to separate this out to just …
plambrechtsen 8654f57
Add displayDeviceName as a config variable.
plambrechtsen d72ea57
Merge branch 'development' into displaydevicename
plambrechtsen 667c3dc
Disable stateBTMeasures(false) as it casues a segfault
plambrechtsen d71cef5
Update docs for displayDeviceName
plambrechtsen d30a59d
Merge branch 'development' into displaydevicename
plambrechtsen 94dda15
Add support to properly decode LYWSD03MMC/MJWSD05MMC, also adding RSSI
plambrechtsen b838e1b
Disable stateBTMeasures(false)
plambrechtsen 43280c9
Fix typo with entity_name for device discovery
plambrechtsen 5587c49
Add support for LYWSD03MMC as a DiscoveryFromList
plambrechtsen 471839c
Add support for LYWSD03MMC as a DiscoveryFromList
plambrechtsen f63ccbf
Adjust voltage to not come in PVVX ENCR payloads
plambrechtsen b350e73
Revert format change
plambrechtsen 66ee03d
Add support for a generic xxWSD0xMMCDiscovery List
plambrechtsen 6b5dd39
Add support for a generic xxWSD0xMMCDiscovery List
plambrechtsen 4cd4a82
Merge branch 'development' into displaydevicename
plambrechtsen f073611
Adjust stack size and disabled code
plambrechtsen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -870,7 +870,7 @@ void setupBTTasksAndBLE() { | |
# if defined(USE_ESP_IDF) || defined(USE_BLUFI) | ||
14500, | ||
# else | ||
9500, /* Stack size in bytes */ | ||
10500, /* Stack size in bytes */ | ||
# endif | ||
NULL, /* Task input parameter */ | ||
2, /* Priority of the task (set higher than core task) */ | ||
|
@@ -955,11 +955,11 @@ void launchBTDiscovery(bool overrideDiscovery) { | |
Log.trace(F("properties: %s" CR), properties.c_str()); | ||
std::string brand = decoder.getTheengAttribute(p->sensorModel_id, "brand"); | ||
std::string model = decoder.getTheengAttribute(p->sensorModel_id, "model"); | ||
# if ForceDeviceName | ||
if (p->name[0] != '\0') { | ||
model = p->name; | ||
if (displayDeviceName || ForceDeviceName) { | ||
if (p->name[0] != '\0') { | ||
1technophile marked this conversation as resolved.
Show resolved
Hide resolved
|
||
model = p->name; | ||
} | ||
} | ||
# endif | ||
std::string model_id = decoder.getTheengAttribute(p->sensorModel_id, "model_id"); | ||
|
||
// Check for tracker status | ||
|
@@ -1014,7 +1014,12 @@ void launchBTDiscovery(bool overrideDiscovery) { | |
Log.trace(F("Key: %s"), prop.key().c_str()); | ||
Log.trace(F("Unit: %s"), prop.value()["unit"].as<const char*>()); | ||
Log.trace(F("Name: %s"), prop.value()["name"].as<const char*>()); | ||
String entity_name = String(model_id.c_str()) + "-" + String(prop.key().c_str()); | ||
String entity_name = ""; | ||
if (displayDeviceName || ForceDeviceName) { | ||
entity_name = String(model.c_str()) + "-" + String(prop.key().c_str()); | ||
} else { | ||
entity_name = String(model_id.c_str()) + "-" + String(prop.key().c_str()); | ||
} | ||
String unique_id = macWOdots + "-" + String(prop.key().c_str()); | ||
String value_template = "{{ value_json." + String(prop.key().c_str()) + " | is_defined }}"; | ||
if (p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::SBS1 && strcmp(prop.key().c_str(), "state") == 0) { | ||
|
@@ -1436,8 +1441,8 @@ void process_bledata(JsonObject& BLEdata) { | |
Log.notice(F("Active and continuous scanning required, parameters adapted" CR)); | ||
stateBTMeasures(false); | ||
} | ||
} else if (BLEdata.containsKey("cont") && BTConfig.BLEinterval != MinTimeBtwScan) { | ||
if (BLEdata["cont"]) { | ||
} else if (BLEdata.containsKey("acts") && BTConfig.BLEinterval != MinTimeBtwScan) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @DigiH Are you okay with this ? |
||
if (BLEdata["acts"]) { | ||
BTConfig.BLEinterval = MinTimeBtwScan; | ||
if ((BLEdata["type"].as<string>()).compare("CTMO") == 0) { | ||
BTConfig.scanDuration = MinScanDuration; | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
instead