Skip to content

Commit 78ca8b2

Browse files
committed
feat(bacnet_secure_connect): setting can now disable polling
1 parent 14e64b7 commit 78ca8b2

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

drivers/ashrae/bacnet_secure_connect.cr

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class Ashrae::BACnetSecureConnect < PlaceOS::Driver
1919
_https_private_key: "-----BEGIN PRIVATE KEY-----",
2020
_https_client_cert: "-----BEGIN CERTIFICATE-----",
2121
verbose_debug: false,
22+
poll_period: 3,
2223
})
2324

2425
def websocket_headers
@@ -82,10 +83,12 @@ class Ashrae::BACnetSecureConnect < PlaceOS::Driver
8283
schedule.every(60.seconds) { bacnet_client.heartbeat! }
8384

8485
poll_period = setting?(UInt32, :poll_period) || 3
85-
schedule.every(poll_period.minutes) do
86-
logger.debug { "--- Polling all known bacnet devices" }
87-
keys = @mutex.synchronize { @devices.keys }
88-
keys.each { |device_id| poll_device(device_id) }
86+
if poll_period > 0
87+
schedule.every(poll_period.minutes) do
88+
logger.debug { "--- Polling all known bacnet devices" }
89+
keys = @mutex.synchronize { @devices.keys }
90+
keys.each { |device_id| poll_device(device_id) }
91+
end
8992
end
9093

9194
perform_discovery

shard.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ shards:
3535

3636
bacnet:
3737
git: https://github.com/spider-gazelle/crystal-bacnet.git
38-
version: 1.0.0+git.commit.e8fbb0672f1d1d9718c013cfa1ed0c0cc4759261
38+
version: 1.0.0+git.commit.0a890615fc53a068d563cf8d034f79a38c10b58a
3939

4040
bindata:
4141
git: https://github.com/spider-gazelle/bindata.git

0 commit comments

Comments
 (0)