Skip to content

Commit

Permalink
rejigger log levels
Browse files Browse the repository at this point in the history
  • Loading branch information
TShapinsky committed Jan 30, 2024
1 parent 8413651 commit 004c9ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions alfalfa_bacnet_bridge/alfalfa_bacnet_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,18 @@ def setup_points(self):
for input in inputs:
if input in outputs:
self.points[input] = LocalAnalogValueObject(objectName=input, objectIdentifier=("analogValue", index), sim_value=outputs[input])
logger.debug(f"Creating BIDIRECTIONAL point: '{input}'")
logger.info(f"Creating BIDIRECTIONAL point: '{input}'")
else:
self.points[input] = AnalogValueCmdObject(objectName=input, objectIdentifier=("analogValue", index))
logger.debug(f"Creating INPUT point: '{input}'")
logger.info(f"Creating INPUT point: '{input}'")
self.points[input]._had_value = False
index += 1

for output in output_names:
if output in self.points:
continue
self.points[output] = AnalogInputObject(objectName=output, objectIdentifier=("analogInput", index), presentValue=outputs[output])
logger.debug(f"Creating OUTPUT point: '{output}'")
logger.info(f"Creating OUTPUT point: '{output}'")
index += 1

for point in self.points.values():
Expand All @@ -134,7 +134,7 @@ def main_loop():

sim_time = self.client.get_sim_time(self.site_id)
except Exception as e:
logger.debug(e)
logger.error(e)
return
self.device._date_time = sim_time

Expand All @@ -152,15 +152,15 @@ def main_loop():
set_inputs[point] = current_value
object._had_value = True
else:
logger.debug(f"Got non-finite value {current_value} for point {point}")
logger.warn(f"Got non-finite value {current_value} for point {point}")
elif object._had_value:
set_inputs[point] = None
object._had_value = False
if len(set_inputs) > 0:
try:
self.client.set_inputs(self.site_id, set_inputs)
except Exception as e:
logger.debug(e)
logger.error(e)


deferred(main_loop)
Expand Down
2 changes: 1 addition & 1 deletion alfalfa_bacnet_bridge/alfalfa_watchdog.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async def main_loop(host: str, alfalfa_site: str, command: str):
logger.info(f"No site found with identifier: '{alfalfa_site}'")

except Exception as e:
print(e)
logger.error(e)

await asyncio.sleep(5)

Expand Down

0 comments on commit 004c9ea

Please sign in to comment.