Comments (2)
A possible fix , would be for the API function to return proper object containing the error status, tested in my setup, it works, and it may be applicable to other areas, but I don't know interaction with HA API:
def check_alarm_status(
self, installation: Installation, referenceId: str
) -> CheckAlarmStatus:
"""Check status of the operation check alarm."""
content = {
"operationName": "CheckAlarmStatus",
"variables": {
"numinst": str(installation.number),
"panel": installation.panel,
"referenceId": referenceId,
"idService": "11",
"counter": 2,
},
"query": "query CheckAlarmStatus($numinst: String!, $idService: String!, $panel: String!, $referenceId: String!) {\n xSCheckAlarmStatus(numinst: $numinst, idService: $idService, panel: $panel, referenceId: $referenceId) {\n res\n msg\n status\n numinst\n protomResponse\n protomResponseDate\n }\n}\n",
}
response = self._execute_request(content)
result_json = json.loads(response.text)
if "errors" in result_json:
error_message = result_json["errors"][0]["message"]
#return error_message <<<< THIS
# _LOGGER.debug(result_json)
return CheckAlarmStatus(
"ERROR",
error_message,
"",
"",
"",
"",
)
else:
raw_data = result_json["data"]["xSCheckAlarmStatus"]
return CheckAlarmStatus(
raw_data["res"],
raw_data["msg"],
raw_data["status"],
raw_data["numinst"],
raw_data["protomResponse"],
raw_data["protomResponseDate"],
)
from securitas-direct-new-api.
Can you check this with the new release v1.1.0.0 I just publish, #33 ?
from securitas-direct-new-api.
Related Issues (20)
- Leer sensores magnéticos HOT 4
- randomically integration crash HOT 2
- Añadir 2 instalaciones HOT 4
- Blocking fail. No se puede desactivar la alarma. HOT 4
- I linked my account but it doesnt show anything HOT 10
- error arming but dissarming HOT 13
- Disarm without code HOT 4
- Cannot connect the alarm HOT 1
- Panel Alarm Entity HOT 1
- Integration with UI force me to setup a code HOT 2
- Update for alarm_control_panel.xxxxx fails HOT 14
- Securitas fails sometime after HASS restart because of expired token or credentials HOT 6
- Tras la última actualización los sensores han dejado de funcionar. HOT 5
- [CLOSED]New feature request - automating the Securitas OTP input HOT 6
- State on HASS is not updated after arming (but physical panel is updated) HOT 9
- 2.3.0.0 update prevents state changes HOT 5
- Sentinel sensors in PT won't work HOT 6
- Erreur lors de l'activation de l'alarme
- Bug: Error when activating/deactivating alarm HOT 1
- Homeassistant no puede ver estado alarma en servidor. HOT 36
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from securitas-direct-new-api.