-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #142 from macifell/indoor-temperature-usb-fix
Adjust temperature under usb power
- Loading branch information
Showing
10 changed files
with
95 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import config | ||
from phew import logging | ||
|
||
DEFAULT_USB_POWER_TEMPERATURE_OFFSET = 4.5 | ||
|
||
|
||
def add_missing_config_settings(): | ||
try: | ||
# check if ca file parameter is set, if not set it to not use SSL by setting to None | ||
config.mqtt_broker_ca_file | ||
except AttributeError: | ||
warn_missing_config_setting("mqtt_broker_ca_file") | ||
config.mqtt_broker_ca_file = None | ||
|
||
try: | ||
config.usb_power_temperature_offset | ||
except AttributeError: | ||
warn_missing_config_setting("usb_power_temperature_offset") | ||
config.usb_power_temperature_offset = DEFAULT_USB_POWER_TEMPERATURE_OFFSET | ||
|
||
|
||
def warn_missing_config_setting(setting): | ||
logging.warn(f"> config setting '{setting}' missing, please add it to config.py") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters