Browse Source

replaced variable type hint incompatible with python3.5

https://github.com/fphammerle/switchbot-mqtt/pull/7/checks?check_run_id=784245627#step:8:33
Fabian Peter Hammerle 3 years ago
parent
commit
d4294995c1
2 changed files with 4 additions and 2 deletions
  1. 2 0
      CHANGELOG.md
  2. 2 2
      switchbot_mqtt/__init__.py

+ 2 - 0
CHANGELOG.md

@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 
 ## [Unreleased]
+### Fixed
+- Replaced variable type hint incompatible with python3.5
 
 ## [0.4.0] - 2020-06-14
 ### Added

+ 2 - 2
switchbot_mqtt/__init__.py

@@ -87,9 +87,9 @@ def _report_state(
     )
     payload = _MQTT_STATE_PAYLOAD_MAPPING[switchbot_state]
     _LOGGER.debug("publishing topic=%s payload=%r", topic, payload)
-    message_info: paho.mqtt.client.MQTTMessageInfo = mqtt_client.publish(
+    message_info = mqtt_client.publish(
         topic=topic, payload=payload, retain=True,
-    )
+    )  # type: paho.mqtt.client.MQTTMessageInfo
     if message_info.rc != paho.mqtt.client.MQTT_ERR_SUCCESS:
         _LOGGER.error("failed to publish state (rc=%d)", message_info.rc)