Coder Social home page Coder Social logo

Comments (6)

cbrherms avatar cbrherms commented on July 26, 2024 1

I think this may be related to a change in Hass code that this component may not have been updated for. Introduced around 0.70

You may have to edit the shinobi.py file that is in the camera folder (joys of custom components, you sometimes have to get your hands dirty).

Change line 16 in that file
FROM

shinobi = loader.get_component('shinobi')

TO

shinobi = hass.components.shinobi

I think that might work. Don't have a setup to test myself though. (I'll edit the code formatting once I get at my comp in a minute, can't add code tags on Mobile)

from homeassistant_custom_components.

jkvalence avatar jkvalence commented on July 26, 2024 1

Okay, I actually like this troubleshooting thing but maaaan was it tough to find.

Here is your code.

shinobi = loader.get_component('shinobi')

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Optional(CONF_WHITELIST, default=[]): cv.ensure_list,
    vol.Optional(CONF_BLACKLIST, default=[]): cv.ensure_list
})


@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
    all_monitors = shinobi.get_all_started_monitors()

I made the following change.

DEPENDENCIES = ['shinobi']
DOMAIN = 'shinobi'

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Optional(CONF_WHITELIST, default=[]): cv.ensure_list,
    vol.Optional(CONF_BLACKLIST, default=[]): cv.ensure_list
})


@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):

    shinobi = loader.get_component(hass, 'shinobi')

You forgot the "hass" argument from the get_component function. I have cameras in my hass configuration now. They don't have jpegs in the overview but i dont have jpeg available in my shinobi, so I'll play with that a little later. Making this change should get it going.

from homeassistant_custom_components.

cbrherms avatar cbrherms commented on July 26, 2024

You've definitely got 2 shinobi.py files?

The one in the root and the one in a camera folder as set out in the repo?

Sounds like it's either not seeing the camera folder, the camera folder is empty, or a permissions issue

from homeassistant_custom_components.

jkvalence avatar jkvalence commented on July 26, 2024

Wow...soooo, you were right, I thought I copied the files but actually just copied the html versions of the github page. So they are now correct, component is set up but.....

I now have a new issue. The API key is set up as all hosts because I could not get the API key to work unless it is all zeros. Group_key is set up and I dont use ssl. This is the error from hass.

Log Details (ERROR)
Tue Jul 10 2018 12:39:05 GMT-0400 (Eastern Daylight Time)

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/setup.py", line 56, in async_setup_component
    return await task
  File "/usr/src/app/homeassistant/setup.py", line 116, in _async_setup_component
    conf_util.async_process_component_config(hass, config, domain)
  File "/usr/src/app/homeassistant/config.py", line 655, in async_process_component_config
    platform = get_platform(hass, domain, p_name)
  File "/usr/src/app/homeassistant/loader.py", line 58, in get_platform
    return get_component(hass, PLATFORM_FORMAT.format(domain, platform))
  File "/usr/src/app/homeassistant/loader.py", line 86, in get_component
    module = importlib.import_module(path)
  File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/config/custom_components/camera/shinobi.py", line 16, in <module>
    shinobi = loader.get_component('shinobi')
TypeError: get_component() missing 1 required positional argument: 'comp_or_platform'

from homeassistant_custom_components.

cbrherms avatar cbrherms commented on July 26, 2024

Don't think the Hass arguement was previously required before 0.70 but good find

from homeassistant_custom_components.

felixsteghofer avatar felixsteghofer commented on July 26, 2024

Thank you very much @jkvalence and @cbrherms !

from homeassistant_custom_components.

Related Issues (6)

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.