Skip to content
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

Wip develop #1719

Merged
merged 308 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
308 commits
Select commit Hold shift + click to select a range
f126041
fix some zigpy debuging modules
pipiche38 Mar 9, 2024
6bf415c
Zigpy Persistent Db
pipiche38 Mar 9, 2024
113e4ee
Enable debuging/logging Python modules
pipiche38 Mar 9, 2024
4a551b5
Plugin wip-develop version 7.2.017
pipiche38 Mar 9, 2024
77f45a9
Allow possibility to have several debug Parameter for one debug message.
pipiche38 Mar 10, 2024
a799ecf
Electric debug param
pipiche38 Mar 10, 2024
b6f1cc9
Adding a Debug parameter, to allow debuging incoming messages for tha…
pipiche38 Mar 10, 2024
d7a3ba4
Fix missing Domo_Update for Metering (thanks to @SylvainPer )
pipiche38 Mar 10, 2024
02ba7fd
enable debuging of ZclClusters
pipiche38 Mar 10, 2024
5ebcdd3
Add Debug flag
pipiche38 Mar 11, 2024
e38ecb8
Add Barometer, Humidity, Illuminance, Occupancy, Temperature debug pa…
pipiche38 Mar 11, 2024
2368a52
fix Humidity which was not updated and add debug Humidity, Temperatur…
pipiche38 Mar 11, 2024
17fa89a
Plugin wip-develop version 7.2.018
pipiche38 Mar 11, 2024
2ea8f4b
update/cosmetics
pipiche38 Mar 11, 2024
f80a4bf
fix bug in Touch()
pipiche38 Mar 11, 2024
c43f168
Plugin wip-develop version 7.2.019
pipiche38 Mar 11, 2024
34bcb1d
In legacy framework we must check unit against DeviceId
pipiche38 Mar 11, 2024
ed3e84e
Plugin wip-develop version 7.2.020
pipiche38 Mar 11, 2024
6ab6554
check that cluster is existing in readZclClusters
pipiche38 Mar 11, 2024
81a2c30
Plugin wip-develop version 7.2.021
pipiche38 Mar 11, 2024
586cb89
comment low level debug, and fix reset_switch_selector_PushButton
pipiche38 Mar 11, 2024
ffcff04
remove logging of configure loggers setup
pipiche38 Mar 11, 2024
f7da54f
Add Temperature debug
pipiche38 Mar 11, 2024
9c1ea5b
disable some of the comment and Touch device only every 120s
pipiche38 Mar 11, 2024
ebc93ff
Plugin wip-develop version 7.2.022
pipiche38 Mar 11, 2024
5697361
Add ListOfDomoticzWidget
pipiche38 Mar 12, 2024
b8d2441
refactor send and retry request()
pipiche38 Mar 12, 2024
94d1528
Fix timeout of device
pipiche38 Mar 12, 2024
8764001
remove Log
pipiche38 Mar 12, 2024
04a7310
prevent calling several times domo_abstract layer
pipiche38 Mar 12, 2024
e174aa8
prevent LastSeen to stress if the last was done in the last DELAY_BET…
pipiche38 Mar 12, 2024
b9ef6e9
Change log message when device coming back to live
pipiche38 Mar 12, 2024
601cd94
prevent doing look for reset devices every second, and delay to each …
pipiche38 Mar 12, 2024
79a5c52
update Domoticz abbstract layer
pipiche38 Mar 12, 2024
3b80a35
Plugin wip-develop version 7.2.023
pipiche38 Mar 12, 2024
4839df3
fix missing Widget_Idx
pipiche38 Mar 12, 2024
36c5989
Plugin wip-develop version 7.2.024
pipiche38 Mar 12, 2024
c6ac4be
fix missing None value
pipiche38 Mar 12, 2024
795df7c
Plugin wip-develop version 7.2.025
pipiche38 Mar 12, 2024
58c8c28
refactor browse_and_reset_devices_if_needed
pipiche38 Mar 12, 2024
8888b69
Plugin wip-develop version 7.2.026
pipiche38 Mar 12, 2024
593c95b
refactor the reset of Motion, Vibration and Switch Selector. Do it wh…
pipiche38 Mar 13, 2024
6e95beb
Plugin wip-develop version 7.2.027
pipiche38 Mar 13, 2024
ac88d7e
dedicate a function for the check and reset
pipiche38 Mar 13, 2024
670f6e5
cosmetic
pipiche38 Mar 13, 2024
511efd0
move Log to Debug
pipiche38 Mar 13, 2024
d4a5704
refactor the way to handle received_packet and get the zigpy persiste…
pipiche38 Mar 13, 2024
2859917
Plugin wip-develop version 7.2.028
pipiche38 Mar 13, 2024
a2c40ca
update debug messages
pipiche38 Mar 15, 2024
575a0c7
hotfix to fix TypeError object of type function has no len
pipiche38 Mar 15, 2024
2e25ef3
relys on zigpy 0.65.5
pipiche38 Mar 16, 2024
238e8b5
#1709 and move device settings to the proper python modules
pipiche38 Mar 16, 2024
b93e269
document as per #1709, the various settings
pipiche38 Mar 16, 2024
316ff7c
Plugin wip-develop version 7.2.029
pipiche38 Mar 16, 2024
bba8e7a
make a rest api to list all parameters and their descriptions if any …
pipiche38 Mar 16, 2024
9bad37e
Plugin wip-develop version 7.2.030
pipiche38 Mar 16, 2024
a8655ed
refactor dispatch and prevent to reinitialize the list of Rest API
pipiche38 Mar 17, 2024
3300126
Plugin wip-develop version 7.2.031
pipiche38 Mar 17, 2024
4a5601b
rest api for Device settings
pipiche38 Mar 17, 2024
fbdd77f
Plugin wip-develop version 7.2.032
pipiche38 Mar 17, 2024
a5bed2c
Send CheckParam attribute to zdevice-name
pipiche38 Mar 17, 2024
99c7515
codefactor fixes
pipiche38 Mar 17, 2024
0dceaee
Move zigpy persistent settings visible in the Experimental settings s…
pipiche38 Mar 17, 2024
cae9373
refactor the read_attributes function
pipiche38 Mar 17, 2024
da99de9
fix error on ReadAttributeRequest_fc11
pipiche38 Mar 17, 2024
c2add8f
enable zigpy.config.CONF_TOPO_SCAN_ENABLED if zigpy persistent Db ena…
pipiche38 Mar 17, 2024
4630342
Plugin wip-develop version 7.2.033
pipiche38 Mar 17, 2024
cad9588
move some logs to debug, and when error provide _context
pipiche38 Mar 18, 2024
05a592a
ùmake sure to use nValue and sValue when calling .Update()
pipiche38 Mar 18, 2024
319220c
WebUi based on Angular 17, and info on the update or not of the devic…
pipiche38 Mar 18, 2024
1a829b1
Plugin wip-develop version 7.2.034
pipiche38 Mar 18, 2024
1893410
When device is disabled, make sure to set the CheckParam flag to False
pipiche38 Mar 18, 2024
3d2ae22
Plugin wip-develop version 7.2.035
pipiche38 Mar 18, 2024
09b26e5
update footer color
pipiche38 Mar 21, 2024
a431754
Plugin wip-develop version 7.2.036
pipiche38 Mar 21, 2024
e3a1e9b
refactoring and make sure that before processing JSON we convert quot…
pipiche38 Mar 23, 2024
00d118f
prevent error if some attributes are not yet defined
pipiche38 Mar 23, 2024
499f9e2
refactor and better handle ModelName
pipiche38 Mar 23, 2024
9600272
Plugin wip-develop version 7.2.037
pipiche38 Mar 23, 2024
0eeb856
better document the Zigpy Topology scanning period
pipiche38 Mar 23, 2024
69f133b
fix (CDevice_update) Failed to parse parameters when updating Type, S…
pipiche38 Mar 24, 2024
bb8ccf8
Plugin wip-develop version 7.2.038
pipiche38 Mar 24, 2024
636bd9e
store nValue:sValue for group during update
pipiche38 Mar 24, 2024
04827ff
Plugin wip-develop version 7.2.039
pipiche38 Mar 24, 2024
e1f441c
report nValue:sValue in /zgroup
pipiche38 Mar 24, 2024
de157fa
Plugin wip-develop version 7.2.040
pipiche38 Mar 24, 2024
34afc60
fix and more infos
pipiche38 Mar 24, 2024
d3e3b9d
Plugin wip-develop version 7.2.041
pipiche38 Mar 24, 2024
3ee35cf
InMemory Zigpy Persistent Db as default
pipiche38 Mar 25, 2024
e65cace
Plugin wip-develop version 7.2.042
pipiche38 Mar 27, 2024
ba46e6d
Topology, revisited the way to handle sibling
pipiche38 Mar 27, 2024
b1c652a
Plugin wip-develop version 7.2.043
pipiche38 Mar 27, 2024
17bf1c4
adding route info if not known
pipiche38 Mar 27, 2024
ae928fd
Plugin wip-develop version 7.2.044
pipiche38 Mar 27, 2024
5faf6a3
Provide an indication if the relation between the 2 nodes are also a …
pipiche38 Mar 27, 2024
5ec56a8
refactor the logging to be more fancy
pipiche38 Mar 27, 2024
c46cfc1
Plugin wip-develop version 7.2.045
pipiche38 Mar 27, 2024
c4dc93f
Merge branch 'stable7' into wip-develop
pipiche38 Mar 27, 2024
966d4ad
Plugin wip-develop version 7.2.046
pipiche38 Mar 27, 2024
b4d1ec3
remove unsuppoorted attributes
pipiche38 Mar 27, 2024
8f7a753
update
pipiche38 Mar 27, 2024
e9dc068
Plugin wip-develop version 7.2.047
pipiche38 Mar 27, 2024
54c9adf
Makes sure _topo is set before calling res_nTopologie_delet()
pipiche38 Mar 29, 2024
9c59e2e
quick fix, need to be better done
pipiche38 Mar 29, 2024
4bd45ea
provide information on a Topology scan in progress via /plugin-health
pipiche38 Apr 2, 2024
527c753
Merge remote-tracking branch 'refs/remotes/origin/wip-develop' into w…
pipiche38 Apr 2, 2024
8069a8c
Write the ListOfDevice to file every 15 minutes
pipiche38 Apr 2, 2024
e562894
fix WebUI issue since Angular upgrade where JSON syntaxt do not match…
pipiche38 Apr 3, 2024
efbc410
Plugin wip-develop version 7.2.048
pipiche38 Apr 3, 2024
6160569
Zigpy topology (#1723)
pipiche38 Apr 3, 2024
fc70a89
Plugin wip-develop version 7.2.049
pipiche38 Apr 3, 2024
f658059
default Topo Scan Period from 4 hours to 12 hours
pipiche38 Apr 4, 2024
53e5784
add a parameter to save all topo scan
pipiche38 Apr 4, 2024
cb85792
Plugin wip-develop version 7.2.050
pipiche38 Apr 4, 2024
d474378
move an error log to debug
pipiche38 Apr 4, 2024
9544cf4
WebUI translations
pipiche38 Apr 4, 2024
907e031
handle command only if ControllerLink is up
pipiche38 Apr 4, 2024
c7e14d8
check nValue, and if None then error and do not process
pipiche38 Apr 4, 2024
1fc2c28
fix update_domoticz_widget when not a blind, not a dimmer
pipiche38 Apr 4, 2024
ae21c63
Plugin wip-develop version 7.2.051
pipiche38 Apr 4, 2024
59a9c61
revert zigpy version to 0.63.4, to prevent https://github.com/zigpy/z…
pipiche38 Apr 4, 2024
6e40d56
Plugin wip-develop version 7.2.052
pipiche38 Apr 4, 2024
742a9ff
remove extra log
pipiche38 Apr 4, 2024
13eff9d
Plugin wip-develop version 7.2.053
pipiche38 Apr 4, 2024
10a39ab
as described in https://github.com/zigpy/zigpy/discussions/1375 force…
pipiche38 Apr 4, 2024
f0d4a4a
Plugin wip-develop version 7.2.054
pipiche38 Apr 4, 2024
91cb6f0
define list of Python modules constraints
pipiche38 Apr 4, 2024
eff588d
in case we find -c constraints.txt string, do no process it
pipiche38 Apr 4, 2024
3f1d426
rely on constraints file for the specific versions
pipiche38 Apr 5, 2024
b950acc
resilience. Check that attribut result is present before browsing it
pipiche38 Apr 5, 2024
e0dd065
Plugin wip-develop version 7.2.055
pipiche38 Apr 5, 2024
b33d326
Address #1680 , and refactor few functions
pipiche38 Apr 6, 2024
d2b6dc0
simplify and reduce complexity (wip) (#1722)
pipiche38 Apr 6, 2024
016db59
Plugin wip-develop version 7.2.056
pipiche38 Apr 6, 2024
dea7cb9
prevent stack trace, when specific Widget Id do not exist
pipiche38 Apr 6, 2024
2350782
stop the periodic zigpy tasks
pipiche38 Apr 6, 2024
34f8bf3
private members for storing topology and interefences task
pipiche38 Apr 6, 2024
25a215b
refactor, and start Topology and Interefence in a dedicated tasks
pipiche38 Apr 6, 2024
8e3082d
Plugin wip-develop version 7.2.057
pipiche38 Apr 6, 2024
503aeca
Adding MacOs hotkey on WebUI dashboard ( z+i+g ) (#1726)
pipiche38 Apr 6, 2024
7c58e37
Plugin wip-develop version 7.2.058
pipiche38 Apr 7, 2024
5c52b05
Refactoring and adding a Tuya Data_request polling mecanism
pipiche38 Apr 7, 2024
8c05ebb
remove code duplication (#1725)
pipiche38 Apr 7, 2024
66b34df
Plugin wip-develop version 7.2.059
pipiche38 Apr 7, 2024
fff0a02
few cosmetic changes
pipiche38 Apr 7, 2024
1ed9d02
Plugin wip-develop version 7.2.060
pipiche38 Apr 7, 2024
8e6926d
fix TypeError: can't subtract offset-naive and offset-aware datetimes
pipiche38 Apr 8, 2024
c89f78c
Plugin wip-develop version 7.2.061
pipiche38 Apr 8, 2024
86f933a
do not track Route and Neighbour, this is now handle by a Topology Scan
pipiche38 Apr 9, 2024
aa419bc
Plugin wip-develop version 7.2.062
pipiche38 Apr 9, 2024
d8a1ee9
if ZigpyTopology remove the old Data Topology (#1727)
pipiche38 Apr 9, 2024
023e5c6
Plugin wip-develop version 7.2.063
pipiche38 Apr 9, 2024
2b2d95d
disable Zigpy OTA
pipiche38 Apr 10, 2024
9b9d522
Plugin wip-develop version 7.2.064
pipiche38 Apr 10, 2024
79b3155
fix issue when ZLinky structutre is not initialized
pipiche38 Apr 12, 2024
aa3b277
Allow to store Tuya Voltage per ep
pipiche38 Apr 12, 2024
620a2eb
update
pipiche38 Apr 12, 2024
caa6ea0
Cookie to manage the number of devices listed in Device Management (#…
pipiche38 Apr 14, 2024
89340f2
Plugin wip-develop version 7.2.065
pipiche38 Apr 14, 2024
5d5799d
dnspython from 2.3.0 to 2.6.1
pipiche38 Apr 14, 2024
3e45502
Plugin wip-develop version 7.2.066
pipiche38 Apr 14, 2024
52f0303
Adding more sensors
pipiche38 Apr 14, 2024
9c27c5d
[zigpy] - In case of zigpy connection lost, restart the plugin (#1732)
pipiche38 Apr 14, 2024
bae3880
Plugin wip-develop version 7.2.067
pipiche38 Apr 14, 2024
6866cc7
update
pipiche38 Apr 14, 2024
4f55126
retreive RSSI from zigpy layer and store it ( #1728)
pipiche38 Apr 15, 2024
a7433ca
Plugin wip-develop version 7.2.068
pipiche38 Apr 15, 2024
8f42f35
Plugin wip-develop version 7.2.069
pipiche38 Apr 15, 2024
1e37877
remove line of comments
pipiche38 Apr 16, 2024
1973dce
should be fixing the Alarm command
pipiche38 Apr 16, 2024
a2f8a44
Add RSSI persistent from one start to the other
pipiche38 Apr 16, 2024
30f15d1
Plugin wip-develop version 7.2.070
pipiche38 Apr 16, 2024
4970be8
Prevent to load cryptopgrahy python module with rust bindings
pipiche38 Apr 16, 2024
43db5a2
Plugin wip-develop version 7.2.071
pipiche38 Apr 16, 2024
02949bb
Instrument EventLoop (#1733)
pipiche38 Apr 19, 2024
cff04a3
Plugin wip-develop version 7.2.072
pipiche38 Apr 19, 2024
e08eb84
refactor and Parameter to enable oldFashion (not optimized)
pipiche38 Apr 20, 2024
476c34f
Zigpy instrument - transport_request (#1734)
pipiche38 Apr 20, 2024
627bf95
Plugin wip-develop version 7.2.073
pipiche38 Apr 20, 2024
399580e
adding more verbose to understand
pipiche38 Apr 24, 2024
f53dd2a
Plugin wip-develop version 7.2.074
pipiche38 Apr 24, 2024
110ab6e
check for tuple and list
pipiche38 Apr 24, 2024
a7e3cd1
Plugin wip-develop version 7.2.075
pipiche38 Apr 24, 2024
ab4bf4b
remove obsolete code, and rely on the optimized version. Do not queue…
pipiche38 Apr 24, 2024
a32d5ab
remove EventLoopThread and loggingNotOptimized as not used any more, …
pipiche38 Apr 24, 2024
9175591
remove unnecessary log
pipiche38 Apr 24, 2024
984261c
remove unnecessary log
pipiche38 Apr 24, 2024
67e54fc
remove unnecessary log
pipiche38 Apr 24, 2024
6e800d3
refactor
pipiche38 Apr 24, 2024
7469d92
Plugin wip-develop version 7.2.076
pipiche38 Apr 24, 2024
996ba51
Update WebUI
pipiche38 Apr 25, 2024
0cdafff
Plugin wip-develop version 7.2.077
pipiche38 Apr 25, 2024
517b2f2
based on the recent PR on Domoticz, we can now update Widget style if…
pipiche38 Apr 25, 2024
b7849ec
remove un-necessary code
pipiche38 Apr 26, 2024
72df042
refactor extract_legacy_report
pipiche38 Apr 26, 2024
85d25b4
cleanup
pipiche38 Apr 26, 2024
3a25513
Plugin wip-develop version 7.2.078
pipiche38 Apr 26, 2024
e3be318
Refactor
pipiche38 Apr 28, 2024
27e0da7
check if internet is enabled or not
pipiche38 Apr 28, 2024
4e53ad8
remove Error log
pipiche38 Apr 28, 2024
a5c2965
refactor of check_plugin_upgrade
pipiche38 Apr 28, 2024
7e6f85c
Plugin wip-develop version 7.2.079
pipiche38 Apr 28, 2024
98efbbc
WebUI update
pipiche38 Apr 28, 2024
07cfbbc
ignore zigpy persistent db in Data
pipiche38 Apr 28, 2024
7ba513f
Plugin wip-develop version 7.2.081
pipiche38 Apr 28, 2024
f766c84
zigpy upstream 0.64.0
pipiche38 Apr 28, 2024
ddbf2f5
Plugin wip-develop version 7.2.082
pipiche38 Apr 28, 2024
eb33ad4
make sure that BuildVersion is also available in Group object
pipiche38 Apr 28, 2024
24a5a56
Plugin wip-develop version 7.2.083
pipiche38 Apr 28, 2024
8cdd78a
Update checkingUpdate.py
pipiche38 Apr 29, 2024
67d00bc
update dns_record_query function
pipiche38 Apr 29, 2024
6cba478
Plugin wip-develop version 7.2.084
pipiche38 Apr 29, 2024
810f067
harmonised startup messages
pipiche38 Apr 29, 2024
f1935c6
update header and License section
pipiche38 Apr 29, 2024
96c8a46
Plugin wip-develop version 7.2.085
pipiche38 Apr 29, 2024
49e214a
update Coordinator communication confirmed
pipiche38 Apr 30, 2024
2fee4dc
cleanup
pipiche38 Apr 30, 2024
0c2f8c9
Plugin wip-develop version 7.2.086
pipiche38 Apr 30, 2024
f17a9f3
remove some log and move it to debug
pipiche38 May 1, 2024
908bcc2
check that data is not None
pipiche38 May 1, 2024
cc47a03
fix issue when PUT /zgroup
pipiche38 May 1, 2024
8fa4c00
fix few issues related to Typename and Group
pipiche38 May 1, 2024
a11896e
Plugin wip-develop version 7.2.087
pipiche38 May 1, 2024
61865c6
rely on zigpy .register_endpoints() instead of having a specific one
pipiche38 May 2, 2024
c3483c5
cosmetic
pipiche38 May 2, 2024
8040085
rely on zigpy .register_endpoints() instead of a specific one
pipiche38 May 2, 2024
fb57506
Plugin wip-develop version 7.2.088
pipiche38 May 2, 2024
12e6447
correct mistake in log
pipiche38 May 2, 2024
7d14abc
upgrade bellows version (#1735)
pipiche38 May 4, 2024
03f8dad
Plugin wip-develop version 7.2.089
pipiche38 May 4, 2024
d6f798a
beurk ... do not know what happened
pipiche38 May 4, 2024
9dd407b
better compute widget style for groups, and in case a On is sent with…
pipiche38 May 4, 2024
333408c
Plugin wip-develop version 7.2.090
pipiche38 May 4, 2024
bf8690b
fix
pipiche38 May 4, 2024
f563520
enhance statistics at shutdown for Zigpy
pipiche38 May 5, 2024
d343850
Plugin wip-develop version 7.2.091
pipiche38 May 5, 2024
d75089d
discover correctly blind under groups (#1736)
pipiche38 May 5, 2024
39a89d7
Plugin wip-develop version 7.2.092
pipiche38 May 5, 2024
5d9dad7
fix codefacor
pipiche38 May 6, 2024
481a48a
implement a specific low cost REST API for plugin ping
pipiche38 May 6, 2024
957832c
Python script to check if the plugin is alive
pipiche38 May 6, 2024
bfd6d1a
magic word and exit with 255 instead of 1
pipiche38 May 6, 2024
e51de30
replace pong:ok by status=Ok
pipiche38 May 6, 2024
e565501
report RSSI on /zdevice znd /zdevice-name
pipiche38 May 7, 2024
3187ce3
add WebUIReactTime parameter
pipiche38 May 7, 2024
42e3ba6
refactor and instrument for reaction time
pipiche38 May 7, 2024
05f5098
Plugin wip-develop version 7.2.093
pipiche38 May 7, 2024
3b5fbcc
Move status to Debug
pipiche38 May 8, 2024
672cc56
fix tab error
pipiche38 May 8, 2024
5d42ad4
Plugin wip-develop version 7.2.094
pipiche38 May 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Data/zigatePDM-*
Data/ZigateGroupsConfig**
Data/Zigate.json
Data/*.backup**
Data/zigpy_persistent**
www/zigate/reports/*
Logs/*
Reports/*
Expand Down
2 changes: 1 addition & 1 deletion .hidden/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"branch": "stable7", "version": "7.1.011"}
{"branch": "wip-develop", "version": "7.2.094"}
151 changes: 56 additions & 95 deletions Classes/AdminWidgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@

"""

import Domoticz
from datetime import datetime
from Modules.domoticzAbstractLayer import (
FreeUnit, domo_create_api, domo_read_nValue_sValue, domo_update_api,
domoticz_error_api, find_first_unit_widget_from_deviceID)

DEVICEID_ADMIN_WIDGET = "Zigate-01-"
DEVICEID_STATUS_WIDGET = "Zigate-02-"
Expand All @@ -21,91 +22,63 @@
DEVICEID_TXT_WIDGET_TXT = "Zigate Notifications"


def _get_switch_selector_options(self, ):
if self.pluginconf.pluginConf["eraseZigatePDM"]:
return {
"LevelActions": "|||||||",
"LevelNames": "Off|Purge Reports|Soft Reset|One Time Enrollment|Perm. Enrollment|Interf Scan|LQI Report|Erase PDM",
"LevelOffHidden": "true",
"SelectorStyle": "0",
}

return {
"LevelActions": "|||||||",
"LevelNames": "Off|Purge Reports|Soft Reset|One Time Enrolmennt|Perm. Enrollment|Interf Scan|LQI Report",
"LevelOffHidden": "true",
"SelectorStyle": "0",
}

class AdminWidgets:
def __init__(self, PluginConf, Devices, ListOfDevices, HardwareID):
def __init__(self, log, PluginConf, pluginParameters, ListOfDomoticzWidget, Devices, ListOfDevices, HardwareID):

self.pluginconf = PluginConf
self.pluginParameters = pluginParameters
self.ListOfDomoticzWidget = ListOfDomoticzWidget
self.Devices = Devices # Point to the List of Domoticz Devices
self.ListOfDevices = ListOfDevices # Point to the Global ListOfDevices
self.HardwareID = HardwareID
self.log = log
self.createStatusWidget(Devices)
self.createNotificationWidget(Devices)
# createAdminWidget( self, Devices )

def FreeUnit(self, Devices):
"""
FreeUnit
Look for a Free Unit number.
"""
for x in range(1, 255):
if x not in Devices:
return x

return len(Devices) + 1

def createAdminWidget(self, Devices):

deviceid_admin_widget = DEVICEID_ADMIN_WIDGET + "%02s" % self.HardwareID
unit = 0
for x in Devices:
if Devices[x].DeviceID == deviceid_admin_widget:
unit = x
break
if unit != 0:

if find_first_unit_widget_from_deviceID(self, Devices, deviceid_admin_widget ):
return

if self.pluginconf.pluginConf["eraseZigatePDM"]:
Options = {
"LevelActions": "|||||||",
"LevelNames": "Off|Purge Reports|Soft Reset|One Time Enrollment|Perm. Enrollment|Interf Scan|LQI Report|Erase PDM",
"LevelOffHidden": "true",
"SelectorStyle": "0",
}
else:
Options = {
"LevelActions": "|||||||",
"LevelNames": "Off|Purge Reports|Soft Reset|One Time Enrolmennt|Perm. Enrollment|Interf Scan|LQI Report",
"LevelOffHidden": "true",
"SelectorStyle": "0",
}

unit = self.FreeUnit(Devices)
widget_name = DEVICEID_ADMIN_WIDGET_TXT + " %02s" % self.HardwareID
myDev = Domoticz.Device(
DeviceID=deviceid_admin_widget,
Name=widget_name,
Unit=unit,
Type=244,
Subtype=62,
Switchtype=18,
Options=Options,
)
myDev.Create()
ID = myDev.ID
if myDev.ID == -1:
Domoticz.Error("createAdminWidget - Fail to create %s. %s" % (widget_name, str(myDev)))
unit = FreeUnit(self, Devices, deviceid_admin_widget, nbunit_=1)
ID = domo_create_api(self, Devices, deviceid_admin_widget, unit, widget_name, Type_=244, Subtype_=62, Switchtype_=18, widgetOptions=_get_switch_selector_options(self))
if ID == -1:
domoticz_error_api("createAdminWidget - Fail to create %s." % (widget_name))
return

def createStatusWidget(self, Devices):

deviceid_status_widget = DEVICEID_STATUS_WIDGET + "%02s" % self.HardwareID
unit = 0
for x in Devices:
if Devices[x].DeviceID == deviceid_status_widget:
unit = x
break
if unit != 0:

if find_first_unit_widget_from_deviceID(self, Devices, deviceid_status_widget):
return

unit = self.FreeUnit(Devices)
unit = FreeUnit(self, Devices, deviceid_status_widget, nbunit_=1)
widget_name = DEVICEID_STATUS_WIDGET_TXT + " %02s" % self.HardwareID
myDev = Domoticz.Device(
DeviceID=deviceid_status_widget, Name=widget_name, Unit=unit, Type=243, Subtype=22, Switchtype=0
)
myDev.Create()
ID = myDev.ID
if myDev.ID == -1:
Domoticz.Error("createAdminWidget - Fail to create %s. %s" % (widget_name, str(myDev)))
ID = domo_create_api(self, Devices, deviceid_status_widget, unit, widget_name, Type_=243, Subtype_=22, Switchtype_=0,)

if ID == -1:
domoticz_error_api("createAdminWidget - Fail to create %s." % (widget_name))
return

self.updateStatusWidget(Devices, "Off")
Expand All @@ -114,23 +87,14 @@ def createStatusWidget(self, Devices):
def createNotificationWidget(self, Devices):

deviceid_txt_widget = DEVICEID_TXT_WIDGET + "%02s" % self.HardwareID
unit = 0
for x in Devices:
if Devices[x].DeviceID == deviceid_txt_widget:
unit = x
break
if unit != 0:
if find_first_unit_widget_from_deviceID(self, Devices, deviceid_txt_widget ):
return

unit = self.FreeUnit(Devices)
unit = FreeUnit(self, Devices, deviceid_txt_widget, nbunit_=1)
widget_name = DEVICEID_TXT_WIDGET_TXT + " %02s" % self.HardwareID
myDev = Domoticz.Device(
DeviceID=deviceid_txt_widget, Name=widget_name, Unit=unit, Type=243, Subtype=19, Switchtype=0
)
myDev.Create()
ID = myDev.ID
if myDev.ID == -1:
Domoticz.Error("createNotificationWidget - Fail to create %s. %s" % (widget_name, str(myDev)))
ID = domo_create_api(self, Devices, deviceid_txt_widget, unit, widget_name, Type_=243, Subtype_=19, Switchtype_=0,)
if ID == -1:
domoticz_error_api("createNotificationWidget - Fail to create %s." % (widget_name))
return

return
Expand All @@ -147,42 +111,39 @@ def handleAdminWidget(self, Devices, Unit, Command, Color):
return

def updateStatusWidget(self, Devices, statusType):

STATUS_WIDGET = {"No Communication": 4, "Startup": 0, "Ready": 1, "Enrollment": 3, "Busy": 3}

deviceid_status_widget = DEVICEID_STATUS_WIDGET + "%02s" % self.HardwareID
if statusType not in STATUS_WIDGET:
return

unit = 0
for x in Devices:
if Devices[x].DeviceID == deviceid_status_widget:
unit = x
break
if unit == 0:
unit = find_first_unit_widget_from_deviceID(self, Devices, deviceid_status_widget )
if not unit:
return

nValue = STATUS_WIDGET[statusType]
sValue = str(statusType)
if sValue != Devices[unit].sValue:
Devices[unit].Update(nValue=nValue, sValue=sValue)

_, cur_svalue = domo_read_nValue_sValue(self, Devices, deviceid_status_widget, unit)

if sValue != cur_svalue:
domo_update_api(self, Devices, deviceid_status_widget, unit, nValue, sValue)

return

def updateNotificationWidget(self, Devices, notification):
deviceid_txt_widget = DEVICEID_TXT_WIDGET + "%02s" % self.HardwareID
unit = 0
for x in Devices:
if Devices[x].DeviceID == deviceid_txt_widget:
unit = x
break
if unit == 0:
unit = find_first_unit_widget_from_deviceID(self, Devices, deviceid_txt_widget )
if not unit:
return

nValue = 0
_, cur_svalue = domo_read_nValue_sValue(self, Devices, deviceid_txt_widget, unit)

sValue = str(notification)
if sValue != Devices[unit].sValue:
Devices[unit].Update(nValue=nValue, sValue=sValue)
if sValue != cur_svalue:
domo_update_api(self, Devices, deviceid_txt_widget, unit, 0, sValue)

def handleCommand(self, Command):
return


5 changes: 3 additions & 2 deletions Classes/DomoticzDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import time
import urllib.request
import ssl
import Domoticz

from Modules.restartPlugin import restartPluginViaDomoticzJsonApi
from Classes.LoggingManagement import LoggingManagement
Expand Down Expand Up @@ -330,7 +329,9 @@ def extract_AddValue(self, ID, attribute):
result = self.get_device_status( ID)
if result is None:
return 0


if 'result' not in result:
return 0
AdjValue = 0
for x in result['result']:
AdjValue = x[attribute]
Expand Down
57 changes: 26 additions & 31 deletions Classes/GroupMgtv2/GroupManagement.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,55 +50,44 @@
# - Managing device short address changes ( could be better to store the IEEE )
#

import os
import json
import os
import pickle

import Domoticz

from Classes.GroupMgtv2.GrpServices import scan_device_for_grp_membership
from Classes.GroupMgtv2.GrpMigration import GrpMgtv2Migration
from Modules.zigateConsts import MAX_LOAD_ZIGATE
from Classes.GroupMgtv2.GrpServices import scan_device_for_grp_membership
from Classes.LoggingManagement import LoggingManagement
from Modules.zigateConsts import MAX_LOAD_ZIGATE


class GroupsManagement(object):

from Classes.GroupMgtv2.GrpDatabase import (load_groups_list_from_json,
update_due_to_nwk_id_change,
write_groups_list)
from Classes.GroupMgtv2.GrpDomoticz import (processCommand,
update_domoticz_group_device)
from Classes.GroupMgtv2.GrpIkeaRemote import \
manageIkeaTradfriRemoteLeftRight
from Classes.GroupMgtv2.GrpResponses import (
statusGroupRequest,
remove_group_member_ship_response,
look_for_group_member_ship_response,
check_group_member_ship_response,
add_group_member_ship_response,
)

from Classes.GroupMgtv2.GrpDomoticz import update_domoticz_group_device, processCommand
from Classes.GroupMgtv2.GrpDatabase import (
write_groups_list,
load_groups_list_from_json,
update_due_to_nwk_id_change,
)
add_group_member_ship_response, check_group_member_ship_response,
look_for_group_member_ship_response, remove_group_member_ship_response,
statusGroupRequest)
from Classes.GroupMgtv2.GrpServices import (
FullRemoveOfGroup,
checkAndTriggerIfMajGroupNeeded,
addGroupMemberShip,
RemoveNwkIdFromAllGroups,
get_available_grp_id,
add_group_member_ship_from_remote,
)
FullRemoveOfGroup, RemoveNwkIdFromAllGroups,
add_group_member_ship_from_remote, addGroupMemberShip,
checkAndTriggerIfMajGroupNeeded, get_available_grp_id)
from Classes.GroupMgtv2.GrpWebServices import (
process_web_request,
ScanAllDevicesForGroupMemberShip,
ScanDevicesForGroupMemberShip,
)
from Classes.GroupMgtv2.GrpIkeaRemote import manageIkeaTradfriRemoteLeftRight
ScanAllDevicesForGroupMemberShip, ScanDevicesForGroupMemberShip,
process_web_request)

def __init__(
self,
zigbee_communitation,
VersionNewFashion,
DomoticzMajor,
DomoticzMinor,
DomoticzBuild,
PluginConf,
ZigateComm,
adminWidgets,
Expand All @@ -107,9 +96,11 @@ def __init__(
Devices,
ListOfDevices,
IEEE2NWK,
ListOfDomoticzWidget,
DeviceConf,
log,
readZclClusters
readZclClusters,
pluginParameters
):
self.zigbee_communication = zigbee_communitation
self.HB = 0
Expand All @@ -131,7 +122,11 @@ def __init__(
self.VersionNewFashion = VersionNewFashion
self.DomoticzMajor = DomoticzMajor
self.DomoticzMinor = DomoticzMinor
self.DomoticzBuild = DomoticzBuild
self.readZclClusters = readZclClusters
self.pluginParameters = pluginParameters
self.ListOfDomoticzWidget = ListOfDomoticzWidget

# Check if we have to open the old format
if os.path.isfile(self.pluginconf.pluginConf["pluginData"] + "/GroupsList-%02d.pck" % hardwareID):
# We are in the Migration from Old Group Managemet to new.
Expand Down
Loading
Loading