Skip to content

Commit 0e1356f

Browse files
committed
Added gen_rain_collector
1 parent b450299 commit 0e1356f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pyvantagepro/device.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,12 @@ def newsetup(self) -> None:
308308
self.wake_up()
309309
self.send("NEWSETUP", self.ACK)
310310

311+
def get_rain_collector(self) -> int:
312+
'''Get rainc ollector type. 0x00 = 0.01", 0x10 = 0.2mm, 0x20 = 0.1mm'''
313+
setup_bits = struct.unpack(b"B", self.read_from_eeprom("2B", 1))[0] # type: ignore
314+
rain_type = setup_bits & 0x30
315+
return rain_type
316+
311317
def set_rain_collector(self, type) -> None:
312318
'''Set rain collector type. 0x00 = 0.01", 0x10 = 0.2mm, 0x20 = 0.1mm'''
313319
setup_bits = struct.unpack(b"B", self.read_from_eeprom("2B", 1))[0] # type: ignore

0 commit comments

Comments
 (0)