GithubHelp home page GithubHelp logo

peternijssen / home-assistant-jumbo Goto Github PK

View Code? Open in Web Editor NEW
7.0 4.0 4.0 68 KB

:convenience_store: Integrate Jumbo.com in Home Assistant

License: MIT License

Python 100.00%
home-assistant hacs supermarket jumbo

home-assistant-jumbo's Introduction

Home Assistant component for Jumbo.com

hacs_badge

Provides Home Assistant sensors for Jumbo (Dutch Supermarket) based on the python-jumbo-api repository.

This library is not affiliated with Jumbo and retrieves data from the endpoints of the mobile application. Use at your own risk.

Install

Use HACS to install these sensors or copy the files in the /custom_components/jumbo/ folder to [homeassistant]/config/custom_components/jumbo/

Example config:

  sensor:
    - platform: jumbo
      username: <username>            (required)
      password: <password>            (required)
      type: "both"                    (optional) (Choose from "delivery", "pick_up" or "both")

Documentation

Questions / Feedback

Share your thoughts within this topic.

Contributors

home-assistant-jumbo's People

Contributors

peternijssen avatar voxxie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

home-assistant-jumbo's Issues

Duplicate code

Both Pick-Up and Delivery are relatively the same sensors. Same goes for the Time Slots for Pick-Up and Delivery. We should minimize the duplicate code or perhaps split the files across multiple sensor files (if possible at all)

Can't connect to the Jumbo API. Is your username/password valid?

Describe the bug
Logger: custom_components.jumbo.sensor
Source: custom_components/jumbo/sensor.py:108
Integration: jumbo (documentation)
First occurred: 22:18:14 (13 occurrences)
Last logged: 23:18:17

Can't connect to the Jumbo API. Is your username/password valid?
To Reproduce

I'm using the following information:

  • platform: jumbo
    username: !secret jumbo_username
    password: !secret jumbo_password

Also I'm using the latest home-assistant version and the master branch of this repo.

I have checked the username and password, and they are accepted on jumbo.com website.

Expected behavior
A couple months ago it was working fine.

Detected I/O inside the event loop

As of 109.x, HA registers I/O inside event loops and discovered a couple in this component. Should be fixed.

Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for jumbo doing I/O at custom_components/jumbo/sensor.py, line 53: api = JumboApi(username, password)
Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for jumbo doing I/O at custom_components/jumbo/sensor.py, line 82: self.basket = self._api.get_basket()

https://developers.home-assistant.io/docs/asyncio_working_with_async/

Update for sensor.jumbo_orders fails

Just added this plugin to HA, after the restart i added the credentials to the config and did another restart. But i currently only have 2 sensors and are missing the basket:
Knipsel
Also tried to add something to my basket on jumbo.com but that didn't help.

2020-05-02 10:45:57 DEBUG (MainThread) [jumbo_api.jumbo_api] Requesting update from https://mobileapi.jumbo.com/v9/stores/slots?storeId=3659&fulfilment=homeDelivery
2020-05-02 10:46:00 ERROR (MainThread) [jumbo_api.jumbo_api] Unable to perform request b'{"code":"4019","message":"No Slots For Date Requested"}'
2020-05-02 10:46:00 ERROR (MainThread) [homeassistant.components.sensor] jumbo: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 322, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 470, in async_device_update
    await self.async_update()
  File "/config/custom_components/jumbo/sensor.py", line 101, in async_update
    await self._data.async_update()
  File "/config/custom_components/jumbo/sensor.py", line 80, in async_update
    self.basket = self._api.get_basket()
  File "/usr/local/lib/python3.7/site-packages/jumbo_api/jumbo_api.py", line 136, in get_basket
    self._update()
  File "/usr/local/lib/python3.7/site-packages/jumbo_api/jumbo_api.py", line 55, in _update
    self._update_time_slots()
  File "/usr/local/lib/python3.7/site-packages/jumbo_api/jumbo_api.py", line 106, in _update_time_slots
    if response['timeSlots'] is False:
TypeError: 'bool' object is not subscriptable

No 'version' key in the manifest file

Describe the bug
No 'version' key in the manifest file for custom integration 'jumbo'. This will not be allowed in a future version of Home Assistant. Please report this to the maintainer of 'jumbo'

Additional context
Since Release 2021.3:
Custom integrations: Version warning

Custom integrations now require a version key in their manifest file, this also means that all custom integrations now require a manifest file.

If you are using a legacy custom integration like custom_components/awesome.py this now needs to move to custom_components/awesome/init.py so you can add custom_components/awesome/manifest.json to it.

For more information about integration, manifests have a look here: https://developers.home-assistant.io/docs/creating_integration_manifest

For now, this will create a warning on startup. But this will eventually be blocked from loading if it’s missing a version in the manifest.

If you see these warnings, please report the issue with the author of that custom integration.

(@ludeeus - #45919)

device_state_attributes Depreciated

Entity sensor.jumbo_delivery_time_slots (<class 'custom_components.jumbo.sensor.DeliveryTimeSlotSensor'>) implements device_state_attributes. Please report it to the custom component author.
Entity sensor.jumbo_pick_up (<class 'custom_components.jumbo.sensor.PickUpSensor'>) implements device_state_attributes. Please report it to the custom component author.
Entity sensor.jumbo_pick_up_time_slots (<class 'custom_components.jumbo.sensor.PickUpTimeSlotSensor'>) implements device_state_attributes. Please report it to the custom component author.
Entity sensor.jumbo_basket (<class 'custom_components.jumbo.sensor.BasketSensor'>) implements device_state_attributes. Please report it to the custom component author.

In [config folder]\custom_components/jumbo/sensor.py replace all device_state_attributes with extra_state_attributes

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.