Skip to content

Commit

Permalink
Merge branch 'master' into feature/caldav-disable-sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Gilles committed May 3, 2021
2 parents 58bfb4d + 8de2652 commit c421ef3
Show file tree
Hide file tree
Showing 35 changed files with 703 additions and 216 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,27 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v4.3.0](https://github.com/GladysAssistant/Gladys/compare/v4.2.4...v4.3.0)

> 26 April 2021
- Refactor dashboard devices-in-room box [`#1138`](https://github.com/GladysAssistant/Gladys/pull/1138)
- Fix Z-wave USB settings list [`#1160`](https://github.com/GladysAssistant/Gladys/pull/1160)
- Fix brightness & multilevel sliders on dashboard [`#1137`](https://github.com/GladysAssistant/Gladys/pull/1137)
- Add time-based condition in scenes [`#1151`](https://github.com/GladysAssistant/Gladys/pull/1151)
- Add new user presence scene triggers [`#1154`](https://github.com/GladysAssistant/Gladys/pull/1154)
- Fix gladys-gateway reconnect bug [`#1159`](https://github.com/GladysAssistant/Gladys/pull/1159)
- Add triggers: house empty and house no longer empty [`#1153`](https://github.com/GladysAssistant/Gladys/pull/1153)
- Keep dot based notation for http request response path [`#1152`](https://github.com/GladysAssistant/Gladys/pull/1152)
- Upgrade preact-i18n to 2.3.1-preactx [`#1133`](https://github.com/GladysAssistant/Gladys/pull/1133)
- Add ability to use request body response in scene HTTP action [`#1148`](https://github.com/GladysAssistant/Gladys/pull/1148)
- Fix #1147: make signup process more responsive [`#1147`](https://github.com/GladysAssistant/Gladys/issues/1147)
- Fix #1161: correct french typo [`#1161`](https://github.com/GladysAssistant/Gladys/issues/1161)
- Fix #1162: correct date format in french scheduled trigger [`#1162`](https://github.com/GladysAssistant/Gladys/issues/1162)
- Update CHANGELOG [`05c2111`](https://github.com/GladysAssistant/Gladys/commit/05c211161c027c3e8d3a957ded6ca34b6ede25b4)
- Fix url in signup process [`8ee5793`](https://github.com/GladysAssistant/Gladys/commit/8ee5793bfa1b3153c8c26bc1e4e2c9b8f2144a8a)
- Add switch dimmer to supported feature types in dashboard box [`b740657`](https://github.com/GladysAssistant/Gladys/commit/b7406570a9e96d4590f78c05bca97a84b8978001)

#### [v4.2.4](https://github.com/GladysAssistant/Gladys/compare/v4.2.3...v4.2.4)

> 16 April 2021
Expand Down
2 changes: 1 addition & 1 deletion front/src/actions/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function createActions(store) {
[deviceIndex]: {
features: {
[deviceFeatureIndex]: {
lastValue: {
last_value: {
$set: value
}
}
Expand Down
79 changes: 18 additions & 61 deletions front/src/components/boxs/device-in-room/DeviceRow.jsx
Original file line number Diff line number Diff line change
@@ -1,75 +1,32 @@
import { createElement } from 'preact';
import { DEVICE_FEATURE_TYPES } from '../../../../../server/utils/constants';

import BinaryDeviceFeature from './device-features/BinaryDeviceFeature';
import ColorDeviceFeature from './device-features/ColorDeviceFeature';
import SensorDeviceFeature from './device-features/SensorDeviceFeature';
import MultilevelDeviceFeature from './device-features/MultiLevelDeviceFeature';
import BrightnessDeviceFeature from './device-features/BrightnessDeviceFeature';
import MultiLevelDeviceFeature from './device-features/MultiLevelDeviceFeature';

const ROW_TYPE_BY_FEATURE_TYPE = {
[DEVICE_FEATURE_TYPES.LIGHT.BINARY]: BinaryDeviceFeature,
[DEVICE_FEATURE_TYPES.LIGHT.COLOR]: ColorDeviceFeature,
[DEVICE_FEATURE_TYPES.SWITCH.DIMMER]: MultiLevelDeviceFeature,
[DEVICE_FEATURE_TYPES.LIGHT.BRIGHTNESS]: MultiLevelDeviceFeature
};

const DeviceRow = ({ children, ...props }) => {
// if device is a sensor, we display the sensor deviceFeature
if (props.deviceFeature.read_only) {
return <SensorDeviceFeature user={props.user} deviceFeature={props.deviceFeature} />;
}

// else, it's not a sensor
// if it's a binary
if (props.deviceFeature.type === 'binary') {
return (
<BinaryDeviceFeature
x={props.x}
y={props.y}
device={props.device}
deviceFeature={props.deviceFeature}
roomIndex={props.roomIndex}
deviceIndex={props.deviceIndex}
deviceFeatureIndex={props.deviceFeatureIndex}
updateValue={props.updateValue}
/>
);
}
if (props.deviceFeature.type === 'color') {
return (
<ColorDeviceFeature
x={props.x}
y={props.y}
device={props.device}
deviceFeature={props.deviceFeature}
roomIndex={props.roomIndex}
deviceIndex={props.deviceIndex}
deviceFeatureIndex={props.deviceFeatureIndex}
updateValue={props.updateValue}
/>
);
}
if (props.deviceFeature.type === 'dimmer') {
return (
<MultilevelDeviceFeature
x={props.x}
y={props.y}
device={props.device}
deviceFeature={props.deviceFeature}
roomIndex={props.roomIndex}
deviceIndex={props.deviceIndex}
deviceFeatureIndex={props.deviceFeatureIndex}
updateValue={props.updateValue}
/>
);
}
if (props.deviceFeature.type === 'brightness') {
return (
<BrightnessDeviceFeature
x={props.x}
y={props.y}
device={props.device}
deviceFeature={props.deviceFeature}
roomIndex={props.roomIndex}
deviceIndex={props.deviceIndex}
deviceFeatureIndex={props.deviceFeatureIndex}
updateValue={props.updateValue}
/>
);
const elementType = ROW_TYPE_BY_FEATURE_TYPE[props.deviceFeature.type];

if (!elementType) {
// if no related components, we return nothing
return null;
}
// if not, we return nothing
return null;

return createElement(elementType, props);
};

export default DeviceRow;
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import actions from '../../../actions/dashboard/edit-boxes/editDevicesInRoom';
const SUPPORTED_FEATURE_TYPES = [
DEVICE_FEATURE_TYPES.LIGHT.BINARY,
DEVICE_FEATURE_TYPES.LIGHT.COLOR,
DEVICE_FEATURE_TYPES.LIGHT.BRIGHTNESS
DEVICE_FEATURE_TYPES.LIGHT.BRIGHTNESS,
DEVICE_FEATURE_TYPES.SWITCH.DIMMER
];

@connect('httpClient', actions)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { Text } from 'preact-i18n';
import get from 'get-value';

import { getDeviceName } from './utils';
import { DeviceFeatureCategoriesIcon } from '../../../../utils/consts';

const MultiLevelDeviceType = ({ children, ...props }) => {
function updateValue(e) {
Expand All @@ -10,24 +13,22 @@ const MultiLevelDeviceType = ({ children, ...props }) => {
props.deviceIndex,
props.deviceFeatureIndex,
e.target.value,
props.deviceFeature.lastValue
props.deviceFeature.last_value
);
}

return (
<tr>
<td>
<i class="fe fe-toggle-right" />
<i
class={`fe fe-${get(
DeviceFeatureCategoriesIcon,
`${props.deviceFeature.category}.${props.deviceFeature.type}`,
{ default: 'arrow-right' }
)}`}
/>
</td>
{props.deviceFeature.deviceFeatureName && <td>{props.deviceFeature.deviceFeatureName}</td>}
{!props.deviceFeature.deviceFeatureName && (
<td>
<Text
id="dashboard.boxes.devicesInRoom.deviceTitle"
fields={{ name: props.deviceFeature.name, type: props.deviceFeature.type }}
/>
</td>
)}
<td>{getDeviceName(props.device, props.deviceFeature)}</td>

<td class="text-right" style="padding-top: 0px; padding-bottom: 0px">
<div class="col">
Expand All @@ -36,7 +37,7 @@ const MultiLevelDeviceType = ({ children, ...props }) => {
minHeight: '30px'
}}
type="range"
value={props.deviceFeature.lastValue}
value={props.deviceFeature.last_value}
onChange={updateValue}
class="form-control custom-range"
step="1"
Expand Down
12 changes: 12 additions & 0 deletions front/src/config/demo.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
"tv-lamp-color",
"tv-lamp-brightness",
"mqtt-living-room-switch",
"mqtt-living-room-dimmer",
"mqtt-living-room-temp"
]
}
Expand Down Expand Up @@ -337,6 +338,17 @@
"last_value": 1,
"last_value_changed": "2019-02-12 07:49:07.556 +00:00"
},
{
"name": "Main Dimmer",
"selector": "mqtt-living-room-dimmer",
"category": "switch",
"type": "dimmer",
"min": 0,
"max": 100,
"read_only": false,
"last_value": 17,
"last_value_changed": "2019-02-12 07:49:07.556 +00:00"
},
{
"name": "Window Temp",
"selector": "mqtt-living-room-temp",
Expand Down
2 changes: 1 addition & 1 deletion front/src/config/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
"title": "Allow me to thank you 🙏",
"introduction": "I'm <a href=\"https://twitter.com/pierregillesl\">Pierre-Gilles Leymarie</a>, and I founded Gladys Assistant in 2013.",
"thanksForChoosingOpenSource": "I would like to thank you for choosing Gladys 🙌 I hope you'll enjoy using this software as much as I enjoyed building it.",
"ifYouWantToSupportThisSotware": "As Gladys is now my main job, I rely on contributions to make this project substainable. If you want to support Gladys and get access to additional features, read more about <a href=\"https://gladysassistant.com\">Gladys Plus</a>.",
"ifYouWantToSupportThisSotware": "As Gladys is now my main job, I rely on contributions to make this project substainable. If you want to support Gladys and get access to additional features, read more about <a href=\"https://gladysassistant.com/plus\">Gladys Plus</a>.",
"goToDashboardButton": "Go to Dashboard"
}
},
Expand Down
10 changes: 5 additions & 5 deletions front/src/config/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
"title": "Merci 🙏",
"introduction": "Je m'appelle <a href=\"https://twitter.com/pierregillesl\"> Pierre-Gilles Leymarie </a>, et j'ai fondé Gladys Assistant en 2013.",
"thanksForChoosingOpenSource": "Je voudrais vous remercier d'avoir choisi Gladys 🙌 J'espère que vous apprécierez utiliser ce logiciel.",
"ifYouWantToSupportThisSotware": "Gladys étant mon activité principale, je compte sur vos contributions pour rendre ce projet durable. Si vous souhaitez accéder à des fonctionnalités supplémentaires et supporter ce projet open-source, rendez-vous sur <a href=\"https://gladysassistant.com/fr/pricing\">Gladys Plus</a>.",
"ifYouWantToSupportThisSotware": "Gladys étant mon activité principale, je compte sur vos contributions pour rendre ce projet durable. Si vous souhaitez accéder à des fonctionnalités supplémentaires et supporter ce projet open-source, rendez-vous sur <a href=\"https://gladysassistant.com/fr/plus\">Gladys Plus</a>.",
"goToDashboardButton": "Accéder au tableau de bord"
}
},
Expand All @@ -188,7 +188,7 @@
"dragAndDrop": "Glissez et déposez moi ici",
"deleteButton": "Supprimer",
"weather": {
"editHouseLabel": "Sélectionnez une maison. J'utiliserais les latitude/longitude pour obtenir la météo.",
"editHouseLabel": "Sélectionnez une maison. J'utiliserai les latitude/longitude pour obtenir la météo.",
"houseHasNoCoordinates": "Les coordonnées de votre maison ne sont pas définies. Accédez aux paramètres Gladys pour définir la position de votre maison.",
"serviceNotConfigured": "Le service OpenWeather n'est pas configuré. Veuillez accéder à l'onglet «Intégrations» et configurer le service OpenWeather.",
"requestToThirdPartyFailed": "La requête à l'API OpenWeather a échouée. Votre instance Gladys est-elle connectée à Internet? Veuillez vous rendre dans le panneau de configuration de OpenWeather pour résoudre ce problème.",
Expand All @@ -204,7 +204,7 @@
},
"devicesInRoom": {
"editRoomLabel": "Sélectionnez la pièce que vous souhaitez afficher ici.",
"editDeviceFeaturesLabel": "Sélectionnez les appareils que vous voulez afficher ici. Seules les capteurs / et interrupteurs on/off sont supportés.",
"editDeviceFeaturesLabel": "Sélectionnez les appareils que vous voulez afficher ici. Seuls les capteurs / et interrupteurs on/off sont supportés.",
"noValue": "Aucune valeur enregistrée.",
"deviceTitle": "{{name}} - {{type}}",
"noDevices": "Vous n'avez pas d'appareil dans votre maison ! <br/> Définissez votre appareil dans la page de l'intégration."
Expand Down Expand Up @@ -861,7 +861,7 @@
"addActionButton": "Nouvelle action",
"noTriggersYet": "Aucun déclencheur n'a encore été ajouté. Il n'est pas obligatoire d'avoir un déclencheur dans une scène.",
"noActionsYet": "Aucune action n'a encore été ajoutée. Cliquez sur le bouton + pour ajouter une action à cette scène.",
"triggersDescription": "Chaque déclencheur est indépendant. Lorsque l'un de ces déclencheurs est déclenché, la scène s'exécute.",
"triggersDescription": "Chaque déclencheur est indépendant. Lorsque les conditions de l'un ces déclencheurs sont respectées, la scène s'exécute.",
"actionsDescription": "Toutes les actions de ce bloc s'exécuteront en parallèle. Pour effectuer une séquence d'actions, ajoutez des actions au bloc suivant.",
"addNewTriggerButton": "Nouveau déclencheur",
"saveSceneError": "Une erreur s'est produite lors de l'enregistrement de votre scène. Veuillez vérifier que toutes les actions / déclencheurs sont remplis et corrects.",
Expand Down Expand Up @@ -1038,7 +1038,7 @@
"intervalLabel": "Intervalle",
"daysOfTheWeekLabel": "Jour de la semaine",
"dayOfTheMonthLabel": "Jour du mois",
"dateFormat": "MM-dd-yyyy",
"dateFormat": "dd/MM/yyyy",
"timeCaption": "Heure",
"units": {
"second": "seconde(s)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@ class RtspCameraBox extends Component {
try {
await this.props.testConnection(this.props.cameraIndex);
this.setState({
testConnectionError: null
testConnectionError: null,
testConnectionErrorMessage: null
});
} catch (e) {
this.setState({
testConnectionError: RequestStatus.Error
testConnectionError: RequestStatus.Error,
testConnectionErrorMessage: get(e, 'response.data.error')
});
}
this.setState({
Expand All @@ -72,7 +74,7 @@ class RtspCameraBox extends Component {
};
componentWillMount() {}

render(props, { loading, saveError, testConnectionError }) {
render(props, { loading, saveError, testConnectionError, testConnectionErrorMessage }) {
return (
<div class="col-md-4">
<div class="card">
Expand All @@ -97,6 +99,7 @@ class RtspCameraBox extends Component {
<Text id="integration.rtspCamera.testConnectionError" />
</div>
)}
{testConnectionErrorMessage && <div class="alert alert-danger">{testConnectionErrorMessage}</div>}
<div class="form-group">
<label>
<Text id="integration.rtspCamera.nameLabel" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,16 @@ const SettingsTab = ({ children, ...props }) => (
<Text id="global.emptySelectOption" />
</option>
{props.usbPorts &&
props.usbPorts.map(usbPort => (
<option value={usbPort.comPath} selected={props.zwaveDriverPath === usbPort.comPath}>
{usbPort.comName}
</option>
))}
props.usbPorts.map(
usbPort =>
usbPort.comPath && (
<option value={usbPort.comPath} selected={props.zwaveDriverPath === usbPort.comPath}>
{usbPort.comPath}
{usbPort.comName ? ` - ${usbPort.comName}` : ''}
{usbPort.comVID ? ` - ${usbPort.comVID}` : ''}
</option>
)
)}
</select>
</div>
<div class="form-group">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ import Profile from '../../../components/user/profile';

const CreateLocalGladysAccount = ({ children, ...props }) => (
<div>
<Link href="/signup" class="btn btn-secondary btn-sm float-left">
<Text id="global.backButton" />
</Link>
<div class="row">
<div class="col mb-4">
<Link href="/signup" class="btn btn-secondary btn-sm float-left">
<Text id="global.backButton" />
</Link>
</div>
</div>
<div class="row">
<div class="col-md-8 mx-auto">
<h2>
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c421ef3

Please sign in to comment.