@@ -1871,6 +1871,68 @@ def getDevice(self):
1871
1871
"rtype" : "zigbee_connectivity"
1872
1872
}]
1873
1873
result ["type" ] = "device"
1874
+ elif self .modelid == "RDM002" and self .type != "ZLLRelativeRotary" :
1875
+ result = {"id" : self .id_v2 , "id_v1" : "/sensors/" + self .id_v1 , "type" : "device" }
1876
+ result ["product_data" ] = {"model_id" : self .modelid ,
1877
+ "manufacturer_name" : "Signify Netherlands B.V." ,
1878
+ "product_name" : "Hue tap dial switch" ,
1879
+ "product_archetype" : "unknown_archetype" ,
1880
+ "certified" : True ,
1881
+ "software_version" : "2.59.25" ,
1882
+ "hardware_platform_type" : "100b-119"
1883
+ }
1884
+ result ["metadata" ] = {
1885
+ "archetype" : "unknown_archetype" ,
1886
+ "name" : self .name
1887
+ }
1888
+ result ["services" ] = [{
1889
+ "rid" : str (uuid .uuid5 (uuid .NAMESPACE_URL , self .id_v2 + 'button1' )),
1890
+ "rtype" : "button"
1891
+ }, {
1892
+ "rid" : str (uuid .uuid5 (uuid .NAMESPACE_URL , self .id_v2 + 'button2' )),
1893
+ "rtype" : "button"
1894
+ }, {
1895
+ "rid" : str (uuid .uuid5 (uuid .NAMESPACE_URL , self .id_v2 + 'button3' )),
1896
+ "rtype" : "button"
1897
+ }, {
1898
+ "rid" : str (uuid .uuid5 (uuid .NAMESPACE_URL , self .id_v2 + 'button4' )),
1899
+ "rtype" : "button"
1900
+ }, {
1901
+ "rid" : str (uuid .uuid5 (uuid .NAMESPACE_URL , self .id_v2 + 'device_power' )),
1902
+ "rtype" : "device_power"
1903
+ }, {
1904
+ "rid" : str (uuid .uuid5 (uuid .NAMESPACE_URL , self .id_v2 + 'zigbee_connectivity' )),
1905
+ "rtype" : "zigbee_connectivity"
1906
+ }]
1907
+ result ["type" ] = "device"
1908
+ elif self .modelid == "RDM002" and self .type == "ZLLRelativeRotary" :
1909
+ result = {"id" : self .id_v2 , "id_v1" : "/sensors/" + self .id_v1 , "type" : "device" }
1910
+ result ["product_data" ] = {"model_id" : self .modelid ,
1911
+ "manufacturer_name" : "Signify Netherlands B.V." ,
1912
+ "product_name" : "Hue tap dial switch" ,
1913
+ "product_archetype" : "unknown_archetype" ,
1914
+ "certified" : True ,
1915
+ "software_version" : "2.59.25" ,
1916
+ "hardware_platform_type" : "100b-119"
1917
+ }
1918
+ result ["metadata" ] = {
1919
+ "archetype" : "unknown_archetype" ,
1920
+ "name" : self .name
1921
+ }
1922
+ result ["services" ] = [{
1923
+ "rid" : str (uuid .uuid5 (uuid .NAMESPACE_URL , self .id_v2 + 'button3' )),
1924
+ "rtype" : "button"
1925
+ }, {
1926
+ "rid" : str (uuid .uuid5 (uuid .NAMESPACE_URL , self .id_v2 + 'button4' )),
1927
+ "rtype" : "button"
1928
+ }, {
1929
+ "rid" : str (uuid .uuid5 (uuid .NAMESPACE_URL , self .id_v2 + 'device_power' )),
1930
+ "rtype" : "device_power"
1931
+ }, {
1932
+ "rid" : str (uuid .uuid5 (uuid .NAMESPACE_URL , self .id_v2 + 'zigbee_connectivity' )),
1933
+ "rtype" : "zigbee_connectivity"
1934
+ }]
1935
+ result ["type" ] = "device"
1874
1936
return result
1875
1937
1876
1938
def getMotion (self ):
@@ -1910,9 +1972,10 @@ def getZigBee(self):
1910
1972
result ["mac_address" ] = self .uniqueid [:23 ]
1911
1973
result ["status" ] = "connected"
1912
1974
return result
1975
+
1913
1976
def getButtons (self ):
1914
1977
result = []
1915
- if self .modelid == "RWL022" or self .modelid == "RWL021" or self .modelid == "RWL020" :
1978
+ if self .modelid == "RWL022" or self .modelid == "RWL021" or self .modelid == "RWL020" or self . modelid == "RDM002" and self . type != "ZLLRelativeRotary" :
1916
1979
for button in range (4 ):
1917
1980
result .append ({
1918
1981
"id" : str (uuid .uuid5 (uuid .NAMESPACE_URL , self .id_v2 + 'button' + str (button + 1 ))),
@@ -1927,6 +1990,20 @@ def getButtons(self):
1927
1990
"type" : "button"
1928
1991
})
1929
1992
return result
1993
+
1994
+ def getRotary (self ):
1995
+ result = []
1996
+ if self .modelid == "RDM002" and self .type == "ZLLRelativeRotary" :
1997
+ result .append ({
1998
+ "id" : str (uuid .uuid5 (uuid .NAMESPACE_URL , self .id_v2 + 'relative_rotary' )),
1999
+ "id_v1" : "/sensors/" + self .id_v1 ,
2000
+ "owner" : {
2001
+ "rid" : self .id_v2 ,
2002
+ "rtype" : "device"
2003
+ },
2004
+ "type" : "relative_rotary"
2005
+ })
2006
+ return result
1930
2007
1931
2008
def getDevicePower (self ):
1932
2009
result = None
0 commit comments