diff --git a/atom.xml b/atom.xml index 3b3cc85eae..40fbe990cf 100644 --- a/atom.xml +++ b/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Home Assistant]]> - 2017-05-01T10:56:30+00:00 + 2017-05-01T13:19:09+00:00 https://home-assistant.io/ diff --git a/blog/categories/announcements/atom.xml b/blog/categories/announcements/atom.xml index 2dad0617a3..b688a8c1a3 100644 --- a/blog/categories/announcements/atom.xml +++ b/blog/categories/announcements/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Announcements | Home Assistant]]> - 2017-05-01T10:56:30+00:00 + 2017-05-01T13:19:09+00:00 https://home-assistant.io/ diff --git a/blog/categories/community/atom.xml b/blog/categories/community/atom.xml index d5a1b9ef63..0c9bcd93c8 100644 --- a/blog/categories/community/atom.xml +++ b/blog/categories/community/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Community | Home Assistant]]> - 2017-05-01T10:56:30+00:00 + 2017-05-01T13:19:09+00:00 https://home-assistant.io/ diff --git a/blog/categories/device-tracking/atom.xml b/blog/categories/device-tracking/atom.xml index 18f4237e5f..4dc3e6e233 100644 --- a/blog/categories/device-tracking/atom.xml +++ b/blog/categories/device-tracking/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Device-Tracking | Home Assistant]]> - 2017-05-01T10:56:30+00:00 + 2017-05-01T13:19:09+00:00 https://home-assistant.io/ diff --git a/blog/categories/esp8266/atom.xml b/blog/categories/esp8266/atom.xml index b611e499a2..50a646ccd9 100644 --- a/blog/categories/esp8266/atom.xml +++ b/blog/categories/esp8266/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: ESP8266 | Home Assistant]]> - 2017-05-01T10:56:30+00:00 + 2017-05-01T13:19:09+00:00 https://home-assistant.io/ diff --git a/blog/categories/how-to/atom.xml b/blog/categories/how-to/atom.xml index 0d3c9d5570..b845db2d11 100644 --- a/blog/categories/how-to/atom.xml +++ b/blog/categories/how-to/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: How-To | Home Assistant]]> - 2017-05-01T10:56:30+00:00 + 2017-05-01T13:19:09+00:00 https://home-assistant.io/ diff --git a/blog/categories/ibeacons/atom.xml b/blog/categories/ibeacons/atom.xml index f74c7cc978..3fa04fea96 100644 --- a/blog/categories/ibeacons/atom.xml +++ b/blog/categories/ibeacons/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: iBeacons | Home Assistant]]> - 2017-05-01T10:56:30+00:00 + 2017-05-01T13:19:09+00:00 https://home-assistant.io/ diff --git a/blog/categories/internet-of-things/atom.xml b/blog/categories/internet-of-things/atom.xml index 27abfcacc8..6f15246be7 100644 --- a/blog/categories/internet-of-things/atom.xml +++ b/blog/categories/internet-of-things/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Internet-of-Things | Home Assistant]]> - 2017-05-01T10:56:30+00:00 + 2017-05-01T13:19:09+00:00 https://home-assistant.io/ diff --git a/blog/categories/iot-data/atom.xml b/blog/categories/iot-data/atom.xml index 2f3d156023..d30c59a6d9 100644 --- a/blog/categories/iot-data/atom.xml +++ b/blog/categories/iot-data/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: IoT-Data | Home Assistant]]> - 2017-05-01T10:56:30+00:00 + 2017-05-01T13:19:09+00:00 https://home-assistant.io/ diff --git a/blog/categories/merchandise/atom.xml b/blog/categories/merchandise/atom.xml index fa89e0d3be..dd4df1fcfb 100644 --- a/blog/categories/merchandise/atom.xml +++ b/blog/categories/merchandise/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Merchandise | Home Assistant]]> - 2017-05-01T10:56:30+00:00 + 2017-05-01T13:19:09+00:00 https://home-assistant.io/ diff --git a/blog/categories/micropython/atom.xml b/blog/categories/micropython/atom.xml index d4d5aeeb00..c3727e915f 100644 --- a/blog/categories/micropython/atom.xml +++ b/blog/categories/micropython/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Micropython | Home Assistant]]> - 2017-05-01T10:56:30+00:00 + 2017-05-01T13:19:09+00:00 https://home-assistant.io/ diff --git a/blog/categories/mqtt/atom.xml b/blog/categories/mqtt/atom.xml index 2022c42374..576f6a1403 100644 --- a/blog/categories/mqtt/atom.xml +++ b/blog/categories/mqtt/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: MQTT | Home Assistant]]> - 2017-05-01T10:56:30+00:00 + 2017-05-01T13:19:09+00:00 https://home-assistant.io/ diff --git a/blog/categories/organisation/atom.xml b/blog/categories/organisation/atom.xml index 5578740d79..09e1e34602 100644 --- a/blog/categories/organisation/atom.xml +++ b/blog/categories/organisation/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Organisation | Home Assistant]]> - 2017-05-01T10:56:30+00:00 + 2017-05-01T13:19:09+00:00 https://home-assistant.io/ diff --git a/blog/categories/owntracks/atom.xml b/blog/categories/owntracks/atom.xml index 67a5edb840..b1548ed8be 100644 --- a/blog/categories/owntracks/atom.xml +++ b/blog/categories/owntracks/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: OwnTracks | Home Assistant]]> - 2017-05-01T10:56:30+00:00 + 2017-05-01T13:19:09+00:00 https://home-assistant.io/ diff --git a/blog/categories/presence-detection/atom.xml b/blog/categories/presence-detection/atom.xml index 9ef0fbce1c..d7d593189d 100644 --- a/blog/categories/presence-detection/atom.xml +++ b/blog/categories/presence-detection/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Presence-Detection | Home Assistant]]> - 2017-05-01T10:56:30+00:00 + 2017-05-01T13:19:09+00:00 https://home-assistant.io/ diff --git a/blog/categories/public-service-announcement/atom.xml b/blog/categories/public-service-announcement/atom.xml index 4f7164055e..4c05e9141e 100644 --- a/blog/categories/public-service-announcement/atom.xml +++ b/blog/categories/public-service-announcement/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Public-Service-Announcement | Home Assistant]]> - 2017-05-01T10:56:30+00:00 + 2017-05-01T13:19:09+00:00 https://home-assistant.io/ diff --git a/blog/categories/release-notes/atom.xml b/blog/categories/release-notes/atom.xml index 2f5b548724..4d17748a13 100644 --- a/blog/categories/release-notes/atom.xml +++ b/blog/categories/release-notes/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Release-Notes | Home Assistant]]> - 2017-05-01T10:56:30+00:00 + 2017-05-01T13:19:09+00:00 https://home-assistant.io/ diff --git a/blog/categories/survey/atom.xml b/blog/categories/survey/atom.xml index 0c59af8d7d..01a4923e5b 100644 --- a/blog/categories/survey/atom.xml +++ b/blog/categories/survey/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Survey | Home Assistant]]> - 2017-05-01T10:56:30+00:00 + 2017-05-01T13:19:09+00:00 https://home-assistant.io/ diff --git a/blog/categories/talks/atom.xml b/blog/categories/talks/atom.xml index db078c3972..88345a3809 100644 --- a/blog/categories/talks/atom.xml +++ b/blog/categories/talks/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Talks | Home Assistant]]> - 2017-05-01T10:56:30+00:00 + 2017-05-01T13:19:09+00:00 https://home-assistant.io/ diff --git a/blog/categories/technology/atom.xml b/blog/categories/technology/atom.xml index 087c738107..53ee8d63f8 100644 --- a/blog/categories/technology/atom.xml +++ b/blog/categories/technology/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Technology | Home Assistant]]> - 2017-05-01T10:56:30+00:00 + 2017-05-01T13:19:09+00:00 https://home-assistant.io/ diff --git a/blog/categories/user-stories/atom.xml b/blog/categories/user-stories/atom.xml index e0cb450daf..5c70b971a4 100644 --- a/blog/categories/user-stories/atom.xml +++ b/blog/categories/user-stories/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: User-Stories | Home Assistant]]> - 2017-05-01T10:56:30+00:00 + 2017-05-01T13:19:09+00:00 https://home-assistant.io/ diff --git a/blog/categories/video/atom.xml b/blog/categories/video/atom.xml index d6c082a758..84e07617f4 100644 --- a/blog/categories/video/atom.xml +++ b/blog/categories/video/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Video | Home Assistant]]> - 2017-05-01T10:56:30+00:00 + 2017-05-01T13:19:09+00:00 https://home-assistant.io/ diff --git a/blog/categories/website/atom.xml b/blog/categories/website/atom.xml index 280c82f3b2..7e1b1939fc 100644 --- a/blog/categories/website/atom.xml +++ b/blog/categories/website/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Website | Home Assistant]]> - 2017-05-01T10:56:30+00:00 + 2017-05-01T13:19:09+00:00 https://home-assistant.io/ diff --git a/developers/add_new_platform/index.html b/developers/add_new_platform/index.html index fa96ecdff7..c8c5a5377d 100644 --- a/developers/add_new_platform/index.html +++ b/developers/add_new_platform/index.html @@ -104,6 +104,7 @@
  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/api/index.html b/developers/api/index.html index 4fe3baef17..b78a474fff 100644 --- a/developers/api/index.html +++ b/developers/api/index.html @@ -95,6 +95,7 @@
  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/architecture/index.html b/developers/architecture/index.html index 31b62b8834..deafe6bb8d 100644 --- a/developers/architecture/index.html +++ b/developers/architecture/index.html @@ -114,6 +114,7 @@
  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/architecture_components/index.html b/developers/architecture_components/index.html index 060dbbb573..fd1313af29 100644 --- a/developers/architecture_components/index.html +++ b/developers/architecture_components/index.html @@ -120,6 +120,7 @@ Diagram showing interaction between components and the Home Assistant core
  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/asyncio/index.html b/developers/asyncio/index.html index 21af4cbce3..aeaea3050d 100644 --- a/developers/asyncio/index.html +++ b/developers/asyncio/index.html @@ -95,6 +95,7 @@
  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/asyncio_101/index.html b/developers/asyncio_101/index.html index bd6349f99f..f06dd89822 100644 --- a/developers/asyncio_101/index.html +++ b/developers/asyncio_101/index.html @@ -93,6 +93,7 @@
  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/asyncio_categorizing_functions/index.html b/developers/asyncio_categorizing_functions/index.html index 25d76c8313..a431e92fbd 100644 --- a/developers/asyncio_categorizing_functions/index.html +++ b/developers/asyncio_categorizing_functions/index.html @@ -132,6 +132,7 @@
  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/asyncio_misc/index.html b/developers/asyncio_misc/index.html index a20eafa641..695bcd4958 100644 --- a/developers/asyncio_misc/index.html +++ b/developers/asyncio_misc/index.html @@ -93,6 +93,7 @@
  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/asyncio_working_with_async/index.html b/developers/asyncio_working_with_async/index.html index 2831f280a4..831c55260b 100644 --- a/developers/asyncio_working_with_async/index.html +++ b/developers/asyncio_working_with_async/index.html @@ -194,6 +194,7 @@
  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/cla/index.html b/developers/cla/index.html index 4dca527816..6bfe37bb93 100644 --- a/developers/cla/index.html +++ b/developers/cla/index.html @@ -118,6 +118,7 @@ and not mention sign-off.

  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/cla_sign/index.html b/developers/cla_sign/index.html index 414484fbcc..09da8de04f 100644 --- a/developers/cla_sign/index.html +++ b/developers/cla_sign/index.html @@ -551,6 +551,7 @@
  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/cla_sign_start/index.html b/developers/cla_sign_start/index.html index 2cb6213de0..c2462a6ac3 100644 --- a/developers/cla_sign_start/index.html +++ b/developers/cla_sign_start/index.html @@ -103,6 +103,7 @@ $(document).ready(function(){
  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/code_of_conduct/index.html b/developers/code_of_conduct/index.html index e908e81ad3..6965994e99 100644 --- a/developers/code_of_conduct/index.html +++ b/developers/code_of_conduct/index.html @@ -147,6 +147,7 @@ available here.

  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/code_review_component/index.html b/developers/code_review_component/index.html index 2c67de8030..f64bc2c623 100644 --- a/developers/code_review_component/index.html +++ b/developers/code_review_component/index.html @@ -118,6 +118,7 @@
  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/code_review_platform/index.html b/developers/code_review_platform/index.html index 982742fa77..5cae870f3a 100644 --- a/developers/code_review_platform/index.html +++ b/developers/code_review_platform/index.html @@ -145,6 +145,7 @@
  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/component_deps_and_reqs/index.html b/developers/component_deps_and_reqs/index.html index 90f393bc6e..85806514f6 100644 --- a/developers/component_deps_and_reqs/index.html +++ b/developers/component_deps_and_reqs/index.html @@ -112,6 +112,7 @@
  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/component_discovery/index.html b/developers/component_discovery/index.html index a31068bed4..da848ddeac 100644 --- a/developers/component_discovery/index.html +++ b/developers/component_discovery/index.html @@ -112,6 +112,7 @@ This option is only available for built-in components.
  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/component_events/index.html b/developers/component_events/index.html index 12551232b3..de2412a3d3 100644 --- a/developers/component_events/index.html +++ b/developers/component_events/index.html @@ -89,6 +89,7 @@
  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/component_generic_discovery/index.html b/developers/component_generic_discovery/index.html index f643982c50..5292a99107 100644 --- a/developers/component_generic_discovery/index.html +++ b/developers/component_generic_discovery/index.html @@ -139,6 +139,7 @@ This can be achieved using the load_platformSetting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/component_initialization/index.html b/developers/component_initialization/index.html index a44b9e2e9e..a0e4df4824 100644 --- a/developers/component_initialization/index.html +++ b/developers/component_initialization/index.html @@ -125,6 +125,7 @@
  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/component_loading/index.html b/developers/component_loading/index.html index fee397197a..70a2c40fd6 100644 --- a/developers/component_loading/index.html +++ b/developers/component_loading/index.html @@ -100,6 +100,7 @@ Home Assistant will use the directory that contains your config file as the dire
  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/component_states/index.html b/developers/component_states/index.html index e3287f10f2..482b75b311 100644 --- a/developers/component_states/index.html +++ b/developers/component_states/index.html @@ -97,6 +97,7 @@
  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/component_visibility/index.html b/developers/component_visibility/index.html index 1efa2e488c..0bdb7437ec 100644 --- a/developers/component_visibility/index.html +++ b/developers/component_visibility/index.html @@ -95,6 +95,7 @@ You can set a suggestion for your entity’s visibility by setting the Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/creating_components/index.html b/developers/creating_components/index.html index 451e21f80f..69d371dc81 100644 --- a/developers/creating_components/index.html +++ b/developers/creating_components/index.html @@ -100,6 +100,7 @@
  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/credits/index.html b/developers/credits/index.html index 0fc24b2541..6dff0ab224 100644 --- a/developers/credits/index.html +++ b/developers/credits/index.html @@ -862,6 +862,7 @@
  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/development/index.html b/developers/development/index.html index 8f1ba956ac..383cee1f94 100644 --- a/developers/development/index.html +++ b/developers/development/index.html @@ -109,6 +109,7 @@
  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/development_catching_up/index.html b/developers/development_catching_up/index.html index 659abee6bc..b16bb6ce77 100644 --- a/developers/development_catching_up/index.html +++ b/developers/development_catching_up/index.html @@ -106,6 +106,7 @@
  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/development_checklist/index.html b/developers/development_checklist/index.html index cec38ad390..6064110265 100644 --- a/developers/development_checklist/index.html +++ b/developers/development_checklist/index.html @@ -99,6 +99,7 @@
  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/development_environment/index.html b/developers/development_environment/index.html index 194c48426d..9c2561456a 100644 --- a/developers/development_environment/index.html +++ b/developers/development_environment/index.html @@ -147,6 +147,7 @@ logging to DEBUG to see even more details about what is going on.

  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/development_guidelines/index.html b/developers/development_guidelines/index.html new file mode 100644 index 0000000000..5256e73b27 --- /dev/null +++ b/developers/development_guidelines/index.html @@ -0,0 +1,245 @@ + + + + + + + + + Style guidelines - Home Assistant + + + + + + + + + + + + + + + + + + + + + + +
    + +
    +
    +
    +
    +
    +
    +

    + Style Guidelines +

    +
    +
    +

    Home Assistant enforces strict PEP8 style and PEP 257 (Docstring Conventions) compliance on all code submitted. We automatically test every pull request as part of the linting process with Coveralls and Travis CI.

    +

    Summary of the most relevant points:

    +
      +
    • Line length is limited to 79 characters (see below).
    • +
    • Use 4 spaces per indentation level. We don’t use tabs.
    • +
    • Comments should be full sentences and end with a period.
    • +
    • Imports should be ordered.
    • +
    • Constants and the content of lists and directories should be in alphabetical order.
    • +
    • Avoid trailing whitespace but surround binary operators with a single space.
    • +
    • Line separator should be set to LF.
    • +
    +

    The maximum line length comes directly from the PEP8 style guide, and is also used by the Python standard library. All code must pass these linting checks, and no exceptions will be made. There have already been numerous requests to increase the maximum line length, but after evaluating the options, the Home Assistant maintainers have decided to stay at 79 characters. This decision is final.

    +

    Those points may require that you adjust your IDE or editor settings.

    +

    Our recommandations

    +

    For some cases PEPs don’t make a statement. This section covers our recommandations about the code style. Those points were collected from the exisiting code and based on what contributors and developers were using the most. This is basically a majority decision, thus you may not agree with it. But we would like to encourage you follow those recommandations to keep the code unified.

    +

    Quotes

    +

    Use single quotes ' for single word and " for multiple words or sentences.

    +
    ATTR_WATERLEVEL = 'level'
    +CONF_ATTRIBUTION = "Data provided by the WUnderground weather service"
    +SENSOR_TYPES = {
    +    'alerts': ['Alerts', None],
    +}
    +
    +
    +

    File headers

    +

    The docstring in the file header should contain a link to the documentation to make it easy to find further information, especially about the configuration or details which are not mentioned in the code.

    +
    """
    +Support for MQTT lights.
    +
    +For more details about this platform, please refer to the documentation at
    +https://home-assistant.io/components/light.mqtt/
    +"""
    +
    +
    +

    Requirements

    +

    Please place Platform requirements right after the imports.

    +
    [...]
    +from homeassistant.helpers.entity import Entity
    +
    +REQUIREMENTS = ['xmltodict==0.11.0']
    +
    +
    +

    Log messages

    +

    There is no need to add the platform or component name to the log messages. This will be added automatically. Like syslog messages there shouldn’t be no period at the end. Try to avoid brackets and additional quotes around the output to make it easier for users to parse the log. A widely style is shown below but you are free to compose the messages as you like.

    +
    _LOGGER.error("No route to device: %s", self._resource)
    +
    +
    +
    2017-05-01 14:28:07 ERROR [homeassistant.components.sensor.arest] No route to device: 192.168.0.18
    +
    +
    +

    Don’t print out wrong API keys, tokens, usernames, or passwords.

    +
    +
    + +
    +
    + + + + diff --git a/developers/development_submitting/index.html b/developers/development_submitting/index.html index 0cfbda4a70..2f20f482fa 100644 --- a/developers/development_submitting/index.html +++ b/developers/development_submitting/index.html @@ -119,6 +119,7 @@
  • Setting up Environment
  • Submit your Work
  • Checklist
  • +
  • Style guidelines
  • Testing
  • Catching up with Reality
  • Validation
  • diff --git a/developers/development_testing/index.html b/developers/development_testing/index.html index 67a8d8edbb..2503549e54 100644 --- a/developers/development_testing/index.html +++ b/developers/development_testing/index.html @@ -66,9 +66,9 @@
    -

    Home Assistant enforces strict PEP8 style compliance on all code submitted. We automatically test every pull request with Coveralls and Travis CI.

    +

    As states in the Style guidelines section all code is checked as part of the linting process and unit test were run.

    Local testing

    -

    Important: Run tox before you create your pull request to avoid annoying fixes. Local testing requires installing tox.

    +

    Important: Run tox before you create your pull request to avoid annoying fixes. Local testing requires installing tox.

    $ pip3 install tox
     
    @@ -100,8 +100,6 @@

    The flake8-docstrings extension will check docstrings according to PEP257 when running Flake8.

    Notes on PyLint and PEP8 validation

    If you can’t avoid a PyLint warning, add a comment to disable the PyLint check for that line with # pylint: disable=YOUR-ERROR-NAME. An example of an unavoidable PyLint warning is not using the passed-in datetime if you’re listening for a time change.

    -

    Maximum Line Length

    -

    As part of the linting process, all code is checked for a maximum line length of 79 characters. This comes directly from the PEP8 style guide, and is also used by the Python standard library. All code must pass these linting checks, and no exceptions will be made. There have already been numerous requests to increase the maximum line length, but after evaluating the options, the Home Assistant maintainers have decided to stay at 79 characters. This decision is final.