{"action":"created","issue":{"url":"https://api.github.com/repos/wpietri/sucks/issues/32","repository_url":"https://api.github.com/repos/wpietri/sucks","labels_url":"https://api.github.com/repos/wpietri/sucks/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/wpietri/sucks/issues/32/comments","events_url":"https://api.github.com/repos/wpietri/sucks/issues/32/events","html_url":"https://github.com/wpietri/sucks/issues/32","id":300396838,"number":32,"title":"Getting started using sucks as a library","user":{"login":"dixi83","id":10693808,"avatar_url":"https://avatars2.githubusercontent.com/u/10693808?v=4","gravatar_id":"","url":"https://api.github.com/users/dixi83","html_url":"https://github.com/dixi83","followers_url":"https://api.github.com/users/dixi83/followers","following_url":"https://api.github.com/users/dixi83/following{/other_user}","gists_url":"https://api.github.com/users/dixi83/gists{/gist_id}","starred_url":"https://api.github.com/users/dixi83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dixi83/subscriptions","organizations_url":"https://api.github.com/users/dixi83/orgs","repos_url":"https://api.github.com/users/dixi83/repos","events_url":"https://api.github.com/users/dixi83/events{/privacy}","received_events_url":"https://api.github.com/users/dixi83/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-02-26T21:09:40Z","updated_at":"2018-03-05T18:55:30Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nI am trying to use use sucks as a library to get some info for my domotica system. I have programming experience but I have not much (almost none) python experience. \r\n\r\nThis is the code I have so far for getting the battery state:\r\n```python\r\nfrom sucks.cli import *\r\n\r\nconfig = read_config()\r\n\r\napi = EcoVacsAPI(config['device_id'], config['email'], config['password_hash'], config['country'], config['continent'])\r\nmy_vac = api.devices()[0]\r\nvacbot = VacBot(api.uid, api.REALM, api.resource, api.user_access_token, my_vac, config['continent'])\r\nvacbot.connect_and_wait_until_ready()\r\n\r\nprint(GetBatteryState())\r\n```\r\n\r\nBut when I execute this code I get a lot of errors:\r\n```\r\n python3 deebot.py\r\nWARNING:sleekxmpp.basexmpp:fulljid property deprecated. Use boundjid.resource\r\nERROR:sleekxmpp.basexmpp:day is out of range for month\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python3.4/dist-packages/sleekxmpp/xmlstream/xmlstream.py\", line 1492, in _process\r\n    if not self.__read_xml():\r\n  File \"/usr/local/lib/python3.4/dist-packages/sleekxmpp/xmlstream/xmlstream.py\", line 1564, in __read_xml\r\n    self.__spawn_event(xml)\r\n  File \"/usr/local/lib/python3.4/dist-packages/sleekxmpp/xmlstream/xmlstream.py\", line 1632, in __spawn_event\r\n    handler.prerun(stanza_copy)\r\n  File \"/usr/local/lib/python3.4/dist-packages/sleekxmpp/xmlstream/handler/callback.py\", line 64, in prerun\r\n    self.run(payload, True)\r\n  File \"/usr/local/lib/python3.4/dist-packages/sleekxmpp/xmlstream/handler/callback.py\", line 76, in run\r\n    self._pointer(payload)\r\n  File \"/usr/local/lib/python3.4/dist-packages/sleekxmpp/features/feature_starttls/starttls.py\", line 64, in _handle_starttls_proceed\r\n    if self.xmpp.start_tls():\r\n  File \"/usr/local/lib/python3.4/dist-packages/sleekxmpp/xmlstream/xmlstream.py\", line 889, in start_tls\r\n    cert.verify(self._expected_server_name, self._der_cert)\r\n  File \"/usr/local/lib/python3.4/dist-packages/sleekxmpp/xmlstream/cert.py\", line 133, in verify\r\n    not_before, not_after = extract_dates(raw_cert)\r\n  File \"/usr/local/lib/python3.4/dist-packages/sleekxmpp/xmlstream/cert.py\", line 111, in extract_dates\r\n    not_before = datetime.strptime(not_before, '%Y%m%d%H%M%SZ')\r\n  File \"/usr/lib/python3.4/_strptime.py\", line 500, in _strptime_datetime\r\n    tt, fraction = _strptime(data_string, format)\r\n  File \"/usr/lib/python3.4/_strptime.py\", line 465, in _strptime\r\n    datetime_date(year, 1, 1).toordinal() + 1\r\nValueError: day is out of range for month\r\nERROR:sleekxmpp.basexmpp:day is out of range for month\r\n```\r\nI installed sucks with \"pip3 install sucks\" and I checked if these libraries are installed and \"requests-mock, nose, pycountry-convert, pycryptodome, requests, click, sleekxmpp\"\r\nI'm proberbly doing something stupid ;) but please help me out\r\n\r\nBest Regads, Martijn"},"comment":{"url":"https://api.github.com/repos/wpietri/sucks/issues/comments/370524236","html_url":"https://github.com/wpietri/sucks/issues/32#issuecomment-370524236","issue_url":"https://api.github.com/repos/wpietri/sucks/issues/32","id":370524236,"user":{"login":"dixi83","id":10693808,"avatar_url":"https://avatars2.githubusercontent.com/u/10693808?v=4","gravatar_id":"","url":"https://api.github.com/users/dixi83","html_url":"https://github.com/dixi83","followers_url":"https://api.github.com/users/dixi83/followers","following_url":"https://api.github.com/users/dixi83/following{/other_user}","gists_url":"https://api.github.com/users/dixi83/gists{/gist_id}","starred_url":"https://api.github.com/users/dixi83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dixi83/subscriptions","organizations_url":"https://api.github.com/users/dixi83/orgs","repos_url":"https://api.github.com/users/dixi83/repos","events_url":"https://api.github.com/users/dixi83/events{/privacy}","received_events_url":"https://api.github.com/users/dixi83/received_events","type":"User","site_admin":false},"created_at":"2018-03-05T18:55:30Z","updated_at":"2018-03-05T18:55:30Z","author_association":"NONE","body":"My trail on error leads to the situation I have now:\r\n\r\nfor the ValueError I found this solution: https://github.com/fritzy/SleekXMPP/issues/478\r\nusing: sleekxmpp 1.3.1, pyasn1 0.4.2 and  pyasn1-modules 0.2.1\r\nI ran into this connection error:\r\n```\r\n# python3 deebot.py\r\nWARNING:sleekxmpp.basexmpp:fulljid property deprecated. Use boundjid.resource\r\nERROR:sleekxmpp.xmlstream.xmlstream:Connection error.\r\nERROR:sleekxmpp.basexmpp:<TagSet object at 0x75d22910 tags 0:32:16> not in asn1Spec: <OctetString schema object at 0x75d3c2b0 tagSet <TagSet object at 0x761b2f90 tags 0:0:4> encoding iso-8859-1>\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python3.4/dist-packages/sleekxmpp/xmlstream/xmlstream.py\", line 1481, in _process\r\n    if not self.__read_xml():\r\n  File \"/usr/local/lib/python3.4/dist-packages/sleekxmpp/xmlstream/xmlstream.py\", line 1553, in __read_xml\r\n    self.__spawn_event(xml)\r\n  File \"/usr/local/lib/python3.4/dist-packages/sleekxmpp/xmlstream/xmlstream.py\", line 1621, in __spawn_event\r\n    handler.prerun(stanza_copy)\r\n  File \"/usr/local/lib/python3.4/dist-packages/sleekxmpp/xmlstream/handler/callback.py\", line 64, in prerun\r\n    self.run(payload, True)\r\n  File \"/usr/local/lib/python3.4/dist-packages/sleekxmpp/xmlstream/handler/callback.py\", line 76, in run\r\n    self._pointer(payload)\r\n  File \"/usr/local/lib/python3.4/dist-packages/sleekxmpp/features/feature_starttls/starttls.py\", line 64, in _handle_starttls_proceed\r\n    if self.xmpp.start_tls():\r\n  File \"/usr/local/lib/python3.4/dist-packages/sleekxmpp/xmlstream/xmlstream.py\", line 882, in start_tls\r\n    cert.verify(self._expected_server_name, self._der_cert)\r\n  File \"/usr/local/lib/python3.4/dist-packages/sleekxmpp/xmlstream/cert.py\", line 142, in verify\r\n    cert_names = extract_names(raw_cert)\r\n  File \"/usr/local/lib/python3.4/dist-packages/sleekxmpp/xmlstream/cert.py\", line 73, in extract_names\r\n    asn1Spec=OctetString())[0]\r\n  File \"/usr/local/lib/python3.4/dist-packages/pyasn1/codec/ber/decoder.py\", line 1318, in __call__\r\n    '%s not in asn1Spec: %r' % (tagSet, asn1Spec)\r\npyasn1.error.PyAsn1Error: <TagSet object at 0x75d22910 tags 0:32:16> not in asn1Spec: <OctetString schema object at 0x75d3c2b0 tagSet <TagSet object at 0x761b2f90 tags 0:0:4> encoding iso-8859-1>\r\n```\r\n\r\nAfter some googling downgrading versions of the used packages:\r\nusing: sleekxmpp 1.3.1, pyasn1 0.3.7 and  pyasn1-modules 0.1.5\r\nI only get into a Warning loop and no actual state of the battery :(\r\n```\r\n# python3 deebot.py\r\nWARNING:sleekxmpp.basexmpp:fulljid property deprecated. Use boundjid.resource\r\ngetbatterystate command\r\nWARNING:sleekxmpp.basexmpp:resource property deprecated. Use boundjid.resource\r\nWARNING:sleekxmpp.basexmpp:resource property deprecated. Use boundjid.resource\r\nWARNING:sleekxmpp.basexmpp:resource property deprecated. Use boundjid.resource\r\nWARNING:sleekxmpp.basexmpp:resource property deprecated. Use boundjid.resource\r\nWARNING:sleekxmpp.basexmpp:resource property deprecated. Use boundjid.resource\r\nWARNING:sleekxmpp.basexmpp:resource property deprecated. Use boundjid.resource\r\n^CException ignored in: <module 'threading' from '/usr/lib/python3.4/threading.py'>\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python3.4/threading.py\", line 1294, in _shutdown\r\n    t.join()\r\n  File \"/usr/lib/python3.4/threading.py\", line 1060, in join\r\n    self._wait_for_tstate_lock()\r\n  File \"/usr/lib/python3.4/threading.py\", line 1076, in _wait_for_tstate_lock\r\n    elif lock.acquire(block, timeout):\r\nKeyboardInterrupt\r\n```\r\nAny suggestions what is left to try or debug for me? \r\nB.T.W. the `sucks clean 1`  and `sucks charge` commands still work ;)"}}
{"actor":{"display_login":"dixi83"}}