Skip to content
This repository was archived by the owner on Jun 7, 2021. It is now read-only.

Commit 9a64285

Browse files
authored
Fixed code formatting in readme
1 parent ad53b12 commit 9a64285

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This library is compatible with Python 3.6+.
1313

1414
`thingserver` can be installed via `pip`, as such:
1515

16-
``` {.sourceCode .shell}
16+
```shell
1717
$ pip install thingserver
1818
```
1919

@@ -38,7 +38,7 @@ required to expose two properties:
3838

3939
First we create a new Thing:
4040

41-
``` {.sourceCode .python}
41+
```python
4242
light = Thing(
4343
'urn:dev:ops:my-lamp-1234',
4444
'My Lamp',
@@ -54,7 +54,7 @@ this, we need to have a Value object which holds the actual state and
5454
also a method to turn the light on/off. For our purposes, we just want
5555
to log the new state if the light is switched on/off.
5656

57-
``` {.sourceCode .python}
57+
```python
5858
light.add_property(
5959
Property(
6060
light,
@@ -72,7 +72,7 @@ The `brightness` property reports the brightness level of the light and
7272
sets the level. Like before, instead of actually setting the level of a
7373
light, we just log the level.
7474

75-
``` {.sourceCode .python}
75+
```python
7676
light.add_property(
7777
Property(
7878
light,
@@ -91,7 +91,7 @@ light.add_property(
9191

9292
Now we can add our newly created thing to the server and start it:
9393

94-
``` {.sourceCode .python}
94+
```python
9595
server = WebThingServer(light, port=8888)
9696

9797
try:
@@ -116,7 +116,7 @@ if the value changes.
116116

117117
First we create a new Thing:
118118

119-
``` {.sourceCode .python}
119+
```python
120120
sensor = Thing(
121121
'urn:dev:ops:my-humidity-sensor-1234',
122122
'My Humidity Sensor',
@@ -131,7 +131,7 @@ Contrary to the light, the value cannot be set via an API call, as it
131131
wouldn't make much sense, to SET what a sensor is reading. Therefore, we
132132
are creating a **readOnly** property.
133133

134-
``` {.sourceCode .python}
134+
```python
135135
sensor.add_property(
136136
Property(
137137
sensor,
@@ -156,7 +156,7 @@ Alternatively, we can create a thread that queries the physical sensor
156156
every few seconds. We first remove the readproperty argument from our
157157
Property.
158158

159-
``` {.sourceCode .python}
159+
```python
160160
sensor.add_property(
161161
Property(
162162
sensor,
@@ -177,7 +177,7 @@ sensor.add_property(
177177
We then create our looping function to periodically query the sensor and
178178
set the property value.
179179

180-
``` {.sourceCode .python}
180+
```python
181181
self.sensor_update_task = \
182182
get_event_loop().create_task(self.update_level())
183183

0 commit comments

Comments
 (0)