{"action":"created","issue":{"url":"https://api.github.com/repos/clach04/python-tuya/issues/29","repository_url":"https://api.github.com/repos/clach04/python-tuya","labels_url":"https://api.github.com/repos/clach04/python-tuya/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/clach04/python-tuya/issues/29/comments","events_url":"https://api.github.com/repos/clach04/python-tuya/issues/29/events","html_url":"https://github.com/clach04/python-tuya/issues/29","id":336660953,"node_id":"MDU6SXNzdWUzMzY2NjA5NTM=","number":29,"title":"Repeated use of status() turns off light","user":{"login":"law1964","id":39134816,"node_id":"MDQ6VXNlcjM5MTM0ODE2","avatar_url":"https://avatars2.githubusercontent.com/u/39134816?v=4","gravatar_id":"","url":"https://api.github.com/users/law1964","html_url":"https://github.com/law1964","followers_url":"https://api.github.com/users/law1964/followers","following_url":"https://api.github.com/users/law1964/following{/other_user}","gists_url":"https://api.github.com/users/law1964/gists{/gist_id}","starred_url":"https://api.github.com/users/law1964/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/law1964/subscriptions","organizations_url":"https://api.github.com/users/law1964/orgs","repos_url":"https://api.github.com/users/law1964/repos","events_url":"https://api.github.com/users/law1964/events{/privacy}","received_events_url":"https://api.github.com/users/law1964/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-06-28T15:04:09Z","updated_at":"2018-12-31T05:53:33Z","closed_at":null,"author_association":"NONE","body":"The light connected to my device starts in the ON (True) state.. I run the following python script:\r\n\r\n```\r\nimport pytuya, time\r\n\r\nold_state=[False, False, False]\r\nSmartLife=[\"\", \"\", \"\"]\r\nSmartLife[1] = pytuya.OutletDevice('02200270ecfabc8e2ff0', '192.168.20.39', 'ceb9acd336c853f2')\r\nSmartLife[2] = pytuya.OutletDevice('04200086b4e62d121b87', '192.168.20.14', '3e637e09ea909522') #Desk Lamp\r\n\r\ndevice_set={2}\r\nfor i in device_set:\r\n    data = SmartLife[i].status()\r\n    old_state[i] = data['dps']['1']\r\n    print (\"*** Polling started \" + time.strftime(\"%a, %d %b %Y %H:%M:%S\", time.localtime())\r\n        + \" \" + str(i) + \" \" + str(old_state[i]) )\r\n\r\nwhile True:\r\n    for i in device_set:\r\n        data = SmartLife[i].status()\r\n        state = data['dps']['1']\r\n        if (state != old_state[i]):\r\n            print time.strftime(\"%a, %d %b %Y %H:%M:%S\", time.localtime()) + \" State has changed to \" + str(i) + \" \" + str(state)\r\n            old_state[i]=state\r\n        time.sleep(0.5)\r\n\r\n```\r\n\r\nThe resulting console output:\r\n\r\n*** Polling started Thu, 28 Jun 2018 10:18:46 2 True\r\nThu, 28 Jun 2018 10:48:33 State has changed to 2 False\r\n\r\nThere are no timers on the device. Nor is there user intervention. The light turns off by itself. This is repeatable (and an eventuality) on multiple but not all devices.\r\n\r\nThoughts?"},"comment":{"url":"https://api.github.com/repos/clach04/python-tuya/issues/comments/450610929","html_url":"https://github.com/clach04/python-tuya/issues/29#issuecomment-450610929","issue_url":"https://api.github.com/repos/clach04/python-tuya/issues/29","id":450610929,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MDYxMDkyOQ==","user":{"login":"aneisch","id":6991461,"node_id":"MDQ6VXNlcjY5OTE0NjE=","avatar_url":"https://avatars1.githubusercontent.com/u/6991461?v=4","gravatar_id":"","url":"https://api.github.com/users/aneisch","html_url":"https://github.com/aneisch","followers_url":"https://api.github.com/users/aneisch/followers","following_url":"https://api.github.com/users/aneisch/following{/other_user}","gists_url":"https://api.github.com/users/aneisch/gists{/gist_id}","starred_url":"https://api.github.com/users/aneisch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aneisch/subscriptions","organizations_url":"https://api.github.com/users/aneisch/orgs","repos_url":"https://api.github.com/users/aneisch/repos","events_url":"https://api.github.com/users/aneisch/events{/privacy}","received_events_url":"https://api.github.com/users/aneisch/received_events","type":"User","site_admin":false},"created_at":"2018-12-31T05:53:33Z","updated_at":"2018-12-31T05:53:33Z","author_association":"NONE","body":"Issue still persists it appears"}}
{"actor":{"display_login":"aneisch"}}