Giter Club home page Giter Club logo

Comments (7)

cgmckeever avatar cgmckeever commented on June 1, 2024

I think the error starts here

 def CustomMode(self, device, mode, schedules=[]):
        """ device can be any object that has parentId == deviceId. i.e., not a camera """
        parentId = device.get('parentId', None)
        if device.get('deviceType') == 'arlobridge':
            return self.request.post(f'https://{self.BASE_URL}/hmsweb/users/devices/automation/active', {'activeAutomations':[{'deviceId':device.get('deviceId'),'timestamp':self.to_timestamp(datetime.now()),'activeModes':[mode],'activeSchedules':schedules}]})
        elif not parentId or device.get('deviceId') == parentId:
            return self.NotifyAndGetResponse(device, {"from":self.user_id+"_web", "to": device.get("parentId"), "action":"set","resource":"modes", "transId": self.genTransId(),"publishResponse":True,"properties":{"active":mode}})
        else:
            raise Exception('Only parent device modes and schedules can be modified.')

where my device type is 'deviceType': 'basestation' and if I INSPECT the web-ui call it is in-fact making a call to /users/devices/automation/active (as opposed to using the self.NotifyAndGetResponse path)

however, short circuiting the device check and using self.request.post also brings up new errors ... looking

from arlo.

cgmckeever avatar cgmckeever commented on June 1, 2024

self.NotifyAndGetResponse (from above) Just appears to sit on

DEBUG:urllib3.connectionpool:https://myapi.arlo.com:443 "POST /hmsweb/users/devices/notify/4R058A7NB5F33 HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://myapi.arlo.com:443 "POST /hmsweb/users/devices/notify/4R058A7NB5F33 HTTP/1.1" 200 None

from arlo.

jeffreydwalter avatar jeffreydwalter commented on June 1, 2024

Hello, thank you for your PR! I made a branch to test out your changes and made some modifications to your proposed solution. Would you mind pulling down this branch and seeing if it works for you? https://github.com/jeffreydwalter/arlo/tree/fix-custom-mode

My basestation died so, I don't actually have any working Arlo cameras anymore. :(

from arlo.

cgmckeever avatar cgmckeever commented on June 1, 2024

I will test shorty, but .. just looking at it, earlier I could not get it to work till I added the schema line .. but maybe you have another change in there accomplishing similar ...

and Ive said in the past -- I would totally send you a basestation ;)

from arlo.

cgmckeever avatar cgmckeever commented on June 1, 2024

I get this

{"error": 401 Client Error: Unauthorized for url: https://myapi.arlo.com/hmsweb/users/devices}

even for something that had worked prior to the hotfix/PR I made

https://github.com/cgmckeever/smartthings/blob/master/arlo-util/www/cgi-bin/checkup.py

from arlo.

cgmckeever avatar cgmckeever commented on June 1, 2024

@jeffreydwalter any thoughts on this?

from arlo.

cgmckeever avatar cgmckeever commented on June 1, 2024
Hello, thank you for your PR! I made a branch to test out your changes and made some modifications to your proposed solution. Would you mind pulling down this branch and seeing if it works for you? https://github.com/jeffreydwalter/arlo/tree/fix-custom-mode

I had tried that and I got

{"error": 401 Client Error: Unauthorized for url: https://myapi.arlo.com/hmsweb/users/devices}

My earlier PR seems to work, but probably is not the clean way to do it ;)

from arlo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.