Skip to content

Commit

Permalink
Don't access Optional enums
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi committed Apr 1, 2018
1 parent ebb3c57 commit dab234e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion miio/airhumidifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class AirHumidifier(Device):
default_output=format_output(
"",
"Power: {result.power}\n"
"Mode: {result.mode.value}\n"
"Mode: {result.mode}\n"
"Temperature: {result.temperature} °C\n"
"Humidity: {result.humidity} %\n"
"LED brightness: {result.led_brightness}\n"
Expand Down
4 changes: 2 additions & 2 deletions miio/airpurifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,9 @@ class AirPurifier(Device):
"Sound volume: {result.volume} %\n"
"Filter RFID product id: {result.filter_rfid_product_id}\n"
"Filter RFID tag: {result.filter_rfid_tag}\n"
"Filter type: {result.filter_type.value}\n"
"Filter type: {result.filter_type}\n"
"Learn mode: {result.learn_mode}\n"
"Sleep mode: {result.sleep_mode.value}\n"
"Sleep mode: {result.sleep_mode}\n"
"Sleep time: {result.sleep_time}\n"
"Sleep mode learn count: {result.sleep_mode_learn_count}\n"
"AQI sensor enabled on power off: {result.auto_detect}\n"
Expand Down

0 comments on commit dab234e

Please sign in to comment.