Jan200101/ShellyPy

Method Not Allowed during initialization

Closed this issue · 3 comments

After the recent firmware update of Shelly Pro 4PM to version 1.0.3 it is no longer possible to initialize the device with the following exception: Bad JSON

After a short debugging session I discovered that in class class Shelly():, method: def __detect__(self, ip, port): POST is used to gather the device information: response = post(url, timeout=5). After changing that to get() (and importing get from requests), Shelly starts responding normally.

This doesn't seem to align with the HTTP API description on the Shelly webpage (they claim that the method doesn't matter) but I might be missing something.

Device Info

{
    "name": "Pool Control",
    "id": "shellypro4pm-c8f09e83efa8",
    "mac": "C8F09E83EFA8",
    "slot": 0,
    "model": "SPSW-104PE16EU",
    "gen": 2,
    "fw_id": "20230912-082358/1.0.3-g6176478",
    "ver": "1.0.3",
    "app": "Pro4PM",
    "auth_en": false,
    "auth_domain": null
}
jaedog commented

seems like post is no longer allowed for the /shelly endpoint. It must be a get.

Edit: After reading Op.. this comment is a dupe. +1 for reading comprehension.

Can reproduce, will fix as soon as I can and release a patch release a new minor version

fix commited
tested against Shelly Gen 1 and 2
tagged as 0.3.0
pushed released to pypi

If this still occurs reopen the issue.