Petites erreurs / SurePetCare

Hello @vedrine ,

J’ai installer ton plugin, pour le moment je n’ai pas intégrer la chatière, je n’ai que la gamelle. du coup tu test quand meme la position meme si pas de chatière >

[2019-05-28 14:19:08][ERROR] : Erreur sur la fonction cron du plugin : Erreur lors de la requete : https://app.api.surehub.io/api/pet/47463/position(GET), data : null erreur : 204

je me pencherai un peux plus sur le plugin Jeudi quand je serai chez moi :wink:

Hum oui je n’avais pas envisagé ce cas pour moi tous les animaux avaient une position, mais en fait dans ton cas c’est faux, il faut que je modifie le code.
EDIT: en fait c’est complexe car on peut très bien avoir une chatière mais que l’animal ne soit enregistré que dans le distributeur. Il faut que je trouve un moyen de tester.

Finalement en réfléchissant à ce que veut dire le code 204, je pense que dans ce cas il ne faut pas générer une exception car on ne peut pas dire que la requête a échoué. Mais le reste du code doit gérer le cas ou la position est indéfinie.

voila mes log :

[2019-06-03 15:04:11][DEBUG] : login result={"data":{"user":{"id":3301,"email_address":"alexandre.orilia@gmail.com","first_name":"Alexandre","last_name":"Orilia","country_id":75,"language_id":47,"photo_id":6838,"marketing_opt_in":true,"terms_accepted":false,"weight_units":0,"version":"Mw==","created_at":"2017-12-31T20:45:14+00:00","updated_at":"2017-12-31T20:46:24+00:00","notifications":{"device_status":true,"animal_movement":true,"intruder_movements":true,"new_device_pet":true,"household_management":true,"photos":true,"low_battery":true,"curfew":true,"feeding_activity":true}},"token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2FwcC5hcGkuc3VyZWh1Yi5pby9hcGkvYXV0aC9sb2dpbiIsImlhdCI6MTU1OTU2NzA1MSwiZXhwIjoxNTkxMDE2NjUxLCJuYmYiOjE1NTk1NjcwNTEsImp0aSI6Im4zVEpvaVh1QTFxR1ZmVXUiLCJzdWIiOjMzMDEsInBydiI6ImIzZWQzZGIzMzRjMmJjMzNiMTg0MjY5NDc1NTc1NmEzZmZiZjVhN2QiLCJkZXZpY2VfaWQiOiIzNzcyNjU3MTI5In0.MTE2XGCsZzhpgo8q_7JJdviKrqK0JiRlfwvB3Utu3Xs"}}
[2019-06-03 15:04:12][DEBUG] : Gethouseholds result : {"data":[{"id":2648,"name":"Maison Villefranche","share_code":"ukzAxuAr32Rl","timezone_id":349,"version":"MQ==","created_at":"2017-12-31T20:46:46+00:00","updated_at":"2017-12-31T20:46:46+00:00"}]}
[2019-06-03 15:04:12][DEBUG] : Found 1 households
[2019-06-03 15:04:12][DEBUG] : Household_config= Array (     [0] => Array         (             [id] => 2648             [name] => Maison Villefranche         )  )
[2019-06-03 15:04:12][DEBUG] : Household id= 2648
[2019-06-03 15:04:12][DEBUG] : Household name= Maison Villefranche
[2019-06-03 15:04:12][DEBUG] : getDevices result : {"data":[{"id":53859,"product_id":1,"household_id":2648,"name":"Maison Villefranche ","serial_number":"H001-0053859","mac_address":"0000D88039766FE6","version":"OTM=","created_at":"2017-06-30T16:27:31+00:00","updated_at":"2019-06-03T01:27:49+00:00"},{"id":195173,"parent_device_id":53859,"product_id":4,"household_id":2648,"name":"Nourriture Mitsuki","serial_number":"U001-0003117","mac_address":"2D0C00C0F9D5B370","index":0,"version":"ODU=","created_at":"2018-12-06T14:47:39+00:00","updated_at":"2019-06-03T01:27:49+00:00","pairing_at":"2019-04-24T19:36:53+00:00"}]}
[2019-06-03 15:04:12][DEBUG] : Device 0={"id":53859,"product_id":1,"household_id":2648,"name":"Maison Villefranche ","serial_number":"H001-0053859","mac_address":"0000D88039766FE6","version":"OTM=","created_at":"2017-06-30T16:27:31+00:00","updated_at":"2019-06-03T01:27:49+00:00"}
[2019-06-03 15:04:12][DEBUG] : debut de postSave
[2019-06-03 15:04:12][DEBUG] : Found config file for product id 1
[2019-06-03 15:04:12][DEBUG] : Products : {         "name": "Hub",         "configuration": {             "id": "",             "product_id": "1",             "parent_device_id": "",             "product_name": "Hub"         },         "commands": [             {                 "name": "En ligne",                 "type": "info",                 "subtype": "binary",                 "isVisible": 0,                 "isHistorized": 1,                 "logicalId": "online",                 "display": {                     "generic_type": "GENERIC_INFO"                 },                 "template":{                     "dashboard" : "badge",                     "mobile" : "badge"                 }             },             {                 "name": "Etat led",                 "type": "info",                 "subtype": "numeric",                 "isVisible": 0,                 "isHistorized": 1,                 "logicalId": "led_mode",                 "display": {                     "generic_type": "GENERIC_INFO"                 },                 "template":{                     "dashboard" : "badge",                     "mobile" : "badge"                 }             },             {                 "name": "Mode led",                 "type": "action",                 "subtype": "select",                 "configuration" :{                     "listValue" : "0|Eteint;1|Brillant;4|Atténué"                 },                 "generic_type": "DONT",                 "isVisible": 1,                 "isHistorized": 0,                 "value" : "Etat led",                 "logicalId": "led_mode::#select#"             }         ] }
[2019-06-03 15:04:12][DEBUG] : debut de postSave
[2019-06-03 15:04:12][DEBUG] : Commande : {"name":"En ligne","type":"info","subtype":"binary","isVisible":0,"isHistorized":1,"logicalId":"online","display":{"generic_type":"GENERIC_INFO"},"template":{"dashboard":"badge","mobile":"badge"}}
[2019-06-03 15:04:12][DEBUG] : Commande : {"name":"Etat led","type":"info","subtype":"numeric","isVisible":0,"isHistorized":1,"logicalId":"led_mode","display":{"generic_type":"GENERIC_INFO"},"template":{"dashboard":"badge","mobile":"badge"}}
[2019-06-03 15:04:12][DEBUG] : Commande : {"name":"Mode led","type":"action","subtype":"select","configuration":{"listValue":"0|Eteint;1|Brillant;4|Att\u00e9nu\u00e9"},"generic_type":"DONT","isVisible":1,"isHistorized":0,"value":"Etat led","logicalId":"led_mode::#select#"}
[2019-06-03 15:04:12][DEBUG] : applyData Array (     [id] => 53859     [product_id] => 1     [household_id] => 2648     [name] => Maison Villefranche      [serial_number] => H001-0053859     [mac_address] => 0000D88039766FE6     [version] => OTM=     [created_at] => 2017-06-30T16:27:31+00:00     [updated_at] => 2019-06-03T01:27:49+00:00 )
[2019-06-03 15:04:12][DEBUG] : [{"_cmds":{"dev.online..":{},"dev.led_mode..":{},"dev.led_mode::#select#..":{}}}]
[2019-06-03 15:04:12][DEBUG] : Device 1={"id":195173,"parent_device_id":53859,"product_id":4,"household_id":2648,"name":"Nourriture Mitsuki","serial_number":"U001-0003117","mac_address":"2D0C00C0F9D5B370","index":0,"version":"ODU=","created_at":"2018-12-06T14:47:39+00:00","updated_at":"2019-06-03T01:27:49+00:00","pairing_at":"2019-04-24T19:36:53+00:00"}
[2019-06-03 15:04:12][DEBUG] : debut de postSave
[2019-06-03 15:04:12][DEBUG] : Found config file for product id 4
[2019-06-03 15:04:12][DEBUG] : Products : { 		"name": "Distributeur", 		"configuration": { 			"id": "", 			"product_id": "4", 			"parent_device_id": "", 			"product_name": "Distributeur de nourriture Connect" 		}, 		"commands": [             {                 "name": "En ligne",                 "type": "info",                 "subtype": "binary",                 "isVisible": 1,                 "isHistorized": 1,                 "logicalId": "online",                 "generic_type": "GENERIC_INFO",                 "template":{                     "dashboard" : "line",                     "mobile" : "line"                 }             } 		] }
[2019-06-03 15:04:12][DEBUG] : debut de postSave
[2019-06-03 15:04:12][DEBUG] : Commande : {"name":"En ligne","type":"info","subtype":"binary","isVisible":1,"isHistorized":1,"logicalId":"online","generic_type":"GENERIC_INFO","template":{"dashboard":"line","mobile":"line"}}
[2019-06-03 15:04:12][DEBUG] : applyData Array (     [id] => 195173     [parent_device_id] => 53859     [product_id] => 4     [household_id] => 2648     [name] => Nourriture Mitsuki     [serial_number] => U001-0003117     [mac_address] => 2D0C00C0F9D5B370     [index] => 0     [version] => ODU=     [created_at] => 2018-12-06T14:47:39+00:00     [updated_at] => 2019-06-03T01:27:49+00:00     [pairing_at] => 2019-04-24T19:36:53+00:00 )
[2019-06-03 15:04:12][DEBUG] : [{"_cmds":{"dev.online..":{},"dev.led_mode..":{},"dev.led_mode::#select#..":{}}},{"_cmds":{"dev.online..":{}}}]
[2019-06-03 15:04:13][DEBUG] : getPets result : {"data":[{"id":47463,"name":"Mitsuki","gender":0,"weight":"9","comments":"","household_id":2648,"breed_id":190,"food_type_id":2,"photo_id":55397,"species_id":2,"tag_id":39162,"version":"Ng==","created_at":"2019-04-26T17:19:05+00:00","updated_at":"2019-04-26T17:24:10+00:00"}]}
[2019-06-03 15:04:13][DEBUG] : Pet 0={"id":47463,"name":"Mitsuki","gender":0,"weight":"9","comments":"","household_id":2648,"breed_id":190,"food_type_id":2,"photo_id":55397,"species_id":2,"tag_id":39162,"version":"Ng==","created_at":"2019-04-26T17:19:05+00:00","updated_at":"2019-04-26T17:24:10+00:00"}
[2019-06-03 15:04:13][DEBUG] : Petfull 0={"id":47463,"name":"Mitsuki","gender":0,"weight":"9","comments":"","household_id":2648,"breed_id":190,"food_type_id":2,"photo_id":55397,"species_id":2,"tag_id":39162,"version":"Ng==","created_at":"2019-04-26T17:19:05+00:00","updated_at":"2019-04-26T17:24:10+00:00","breed":{"id":190,"name":"Spitz japonais","species_id":2,"version":"MA=="},"photo":{"id":55397,"location":"https:\/\/surehub.s3.amazonaws.com\/user-photos\/thm\/3301\/LnbvgCu08sTKPJ2iFv6UVN0t1ZwXeHZiQRqXKTeUBc.jpg","uploading_user_id":3301,"version":"MA==","created_at":"2019-04-26T17:23:20+00:00","updated_at":"2019-04-26T17:23:20+00:00"},"species":{"id":2,"name":"Chien","version":"MA=="},"tag":{"id":39162,"tag":"0112bafa9c","version":"MQ==","created_at":"2019-04-26T17:19:05+00:00","updated_at":"2019-04-26T17:19:05+00:00","supported_product_ids":[3,4,6]}}
[2019-06-03 15:04:13][DEBUG] : debut de postSave
[2019-06-03 15:04:13][DEBUG] : [{"_cmds":{"dev.online..":{},"dev.led_mode..":{},"dev.led_mode::#select#..":{}}},{"_cmds":{"dev.online..":{}}},{"_cmds":{"pet.position..":{},"pet.setposition::#select#..":{}}}]```