athombv / homey-web-api-issues

This issue tracker is for Homey Developers using the Web API.
4 stars 1 forks source link

WebAPI v3 - Flows don't return "broken" #44

Closed martijnpoppen closed 1 year ago

martijnpoppen commented 1 year ago

When calling flows.getFlows(). The result doens't contain broken: true/false The New homey app doesn't indicate the broken flows and FlowChecker is also unable to tell if a flow is broken.

Example response of: Object.values(flows.getFlows())[0]

Flow {
  id: 'fabb3752-7770-4a10-a028-e8748ed553c1',
  uri: 'homey:flow:fabb3752-7770-4a10-a028-e8748ed553c1',
  name: 'Ochtend - Lampen aan',
  enabled: true,
  folder: '68563f01-244b-4fd3-87e9-49a45d386b8b',
  order: 3,
  trigger: { id: 'homey:zone:2ab5a003-0120-4c01-80f2-a237dcf4ba14:active' },
  conditions: [
    {
      id: 'homey:manager:cron:time_between',
      group: 'group1',
      args: [Object]
    },
    {
      group: 'group1',
      id: 'homey:manager:cron:day_equals',
      args: [Object]
    }
  ],
  actions: [
    {
      id: 'homey:device:59c55cb3-a2b3-4147-89c2-3f821c261968:dim',
      args: [Object],
      group: 'then'
    }
  ],
  triggerable: true,
  triggerCount: 20537
}

Expected result: Broken should be part of the Flow response

jeroenwienk commented 1 year ago

When calling flows.getFlows(). The result doens't contain broken: true/false The New homey app doesn't indicate the broken flows and FlowChecker is also unable to tell if a flow is broken.

Example response of: Object.values(flows.getFlows())[0]

Flow {
  id: 'fabb3752-7770-4a10-a028-e8748ed553c1',
  uri: 'homey:flow:fabb3752-7770-4a10-a028-e8748ed553c1',
  name: 'Ochtend - Lampen aan',
  enabled: true,
  folder: '68563f01-244b-4fd3-87e9-49a45d386b8b',
  order: 3,
  trigger: { id: 'homey:zone:2ab5a003-0120-4c01-80f2-a237dcf4ba14:active' },
  conditions: [
    {
      id: 'homey:manager:cron:time_between',
      group: 'group1',
      args: [Object]
    },
    {
      group: 'group1',
      id: 'homey:manager:cron:day_equals',
      args: [Object]
    }
  ],
  actions: [
    {
      id: 'homey:device:59c55cb3-a2b3-4147-89c2-3f821c261968:dim',
      args: [Object],
      group: 'then'
    }
  ],
  triggerable: true,
  triggerCount: 20537
}

Expected result: Broken should be part of the Flow response

We have decided we are going to be removing this property in favor of checking client side if a Flow is broken. There is a method on Flow and AdvancedFlow isBroken() that you can use.

martijnpoppen commented 1 year ago

Thanks!

martijnpoppen commented 1 year ago

@jeroenwienk unfortunately that doesn't work:

Got this rejection:

 Error: Flow.isBroken requires ManagerFlow to be connected.