We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
到底为什么会把布尔值当作字符串的值啊?! 在示例代码里面,以下这段话根本无法进行电源状态变更,因为pState是一个字符串而返回值是"true"和”false“ 首先,按照代码里面的on和off是根本就没判断。 其次,按照代码逻辑,返回值是真假应该是布尔变量直接判断也不行。 也就是说,非得把布尔值当作字符串用。 什么情况啊,示例代码不按照代码规范写还是个出错不能运行的。
pState
set_state = message.data["pState"] print("change power state to : {0}".format(set_state)) if set_state == "on": pass elif set_state == "off": pass
也就是说这段代码正常运行应该是这样的:
set_state = message.data["pState"] print("change power state to : {0}".format(set_state)) if set_state == "true": pass elif set_state == "false": pass
https://github.com/blinker-iot/blinker-py/blob/dev_3.0/example/voice_assistant.py
The text was updated successfully, but these errors were encountered:
No branches or pull requests
到底为什么会把布尔值当作字符串的值啊?!
在示例代码里面,以下这段话根本无法进行电源状态变更,因为
pState
是一个字符串而返回值是"true"和”false“首先,按照代码里面的on和off是根本就没判断。
其次,按照代码逻辑,返回值是真假应该是布尔变量直接判断也不行。
也就是说,非得把布尔值当作字符串用。
什么情况啊,示例代码不按照代码规范写还是个出错不能运行的。
也就是说这段代码正常运行应该是这样的:
https://github.com/blinker-iot/blinker-py/blob/dev_3.0/example/voice_assistant.py
The text was updated successfully, but these errors were encountered: